pub trait PortLocalServerHandler<___T: Transport = Channel> {
// Required methods
fn get_info(
&mut self,
responder: Responder<GetInfo, ___T>,
) -> impl Future<Output = ()>;
fn get_status(
&mut self,
responder: Responder<GetStatus, ___T>,
) -> impl Future<Output = ()>;
fn get_status_watcher(
&mut self,
request: Request<GetStatusWatcher, ___T>,
) -> impl Future<Output = ()>;
fn get_mac(
&mut self,
request: Request<GetMac, ___T>,
) -> impl Future<Output = ()>;
fn get_device(
&mut self,
request: Request<GetDevice, ___T>,
) -> impl Future<Output = ()>;
fn clone(
&mut self,
request: Request<Clone, ___T>,
) -> impl Future<Output = ()>;
fn get_counters(
&mut self,
responder: Responder<GetCounters, ___T>,
) -> impl Future<Output = ()>;
fn get_diagnostics(
&mut self,
request: Request<GetDiagnostics, ___T>,
) -> impl Future<Output = ()>;
fn get_identity(
&mut self,
responder: Responder<GetIdentity, ___T>,
) -> impl Future<Output = ()>;
fn get_power_dependency_token(
&mut self,
responder: Responder<GetPowerDependencyToken, ___T>,
) -> impl Future<Output = ()>;
}Expand description
A server handler for the Port protocol.
See Port for more details.
Required Methods§
Sourcefn get_info(
&mut self,
responder: Responder<GetInfo, ___T>,
) -> impl Future<Output = ()>
fn get_info( &mut self, responder: Responder<GetInfo, ___T>, ) -> impl Future<Output = ()>
Obtain information about port.
- response
infoport information.
Sourcefn get_status(
&mut self,
responder: Responder<GetStatus, ___T>,
) -> impl Future<Output = ()>
fn get_status( &mut self, responder: Responder<GetStatus, ___T>, ) -> impl Future<Output = ()>
Obtain the operating port status.
- response
statussnapshot of port’s current status.
Sourcefn get_status_watcher(
&mut self,
request: Request<GetStatusWatcher, ___T>,
) -> impl Future<Output = ()>
fn get_status_watcher( &mut self, request: Request<GetStatusWatcher, ___T>, ) -> impl Future<Output = ()>
Connects to a StatusWatcher to observe port status changes.
- request
watcherhandle to the status watcher. - request
bufferthe number of status changes that the client requests to be stored byStatusWatcher. Values are capped atMAX_STATUS_BUFFER. A value of 0 or 1 causes theStatusWatcherto not keep any buffers on status changed. Clients that need to observe all changes to status (as opposed to only the current state) are encouraged to set a buffer value larger than 1, so that all edges can be observed. IfStatusWatcher’s internal queue is filled and new status changes occur, the oldest samples will be dropped to make room for new ones.
Sourcefn get_mac(
&mut self,
request: Request<GetMac, ___T>,
) -> impl Future<Output = ()>
fn get_mac( &mut self, request: Request<GetMac, ___T>, ) -> impl Future<Output = ()>
Connects to a MacAddressing associated with the port.
- request
macmac handle. Closed withZX_ERR_NOT_SUPPORTEDif this port does not support mac addressing.
Sourcefn get_device(
&mut self,
request: Request<GetDevice, ___T>,
) -> impl Future<Output = ()>
fn get_device( &mut self, request: Request<GetDevice, ___T>, ) -> impl Future<Output = ()>
Connects to the Device this port belongs to.
- request
devicegrants access to the parent device.
Sourcefn clone(&mut self, request: Request<Clone, ___T>) -> impl Future<Output = ()>
fn clone(&mut self, request: Request<Clone, ___T>) -> impl Future<Output = ()>
Establishes a new connection to this port.
- request
portthe server end for the new connection.
Sourcefn get_counters(
&mut self,
responder: Responder<GetCounters, ___T>,
) -> impl Future<Output = ()>
fn get_counters( &mut self, responder: Responder<GetCounters, ___T>, ) -> impl Future<Output = ()>
Retrieves a snapshot of traffic counters on this port.
Sourcefn get_diagnostics(
&mut self,
request: Request<GetDiagnostics, ___T>,
) -> impl Future<Output = ()>
fn get_diagnostics( &mut self, request: Request<GetDiagnostics, ___T>, ) -> impl Future<Output = ()>
Grants access to Diagnostics for this port.
- request
diagnosticsgrants access to diagnostics information.
Sourcefn get_identity(
&mut self,
responder: Responder<GetIdentity, ___T>,
) -> impl Future<Output = ()>
fn get_identity( &mut self, responder: Responder<GetIdentity, ___T>, ) -> impl Future<Output = ()>
Retrieves a unique event handle that is always associated only with this port.
This event may be used to uniquely identify a specific port instance across different APIs in the system.
Sourcefn get_power_dependency_token(
&mut self,
responder: Responder<GetPowerDependencyToken, ___T>,
) -> impl Future<Output = ()>
fn get_power_dependency_token( &mut self, responder: Responder<GetPowerDependencyToken, ___T>, ) -> impl Future<Output = ()>
Gets the Power Broker dependency token for this port’s power element.
The token exposes two levels: 0 (off) and 1 (on). Clients lease
level 1 whenever the port’s datapath is required and hold the lease
for as long as it is required. Drivers are free to internally
power-manage a leased-but-idle port so long as it’s invisible to upper
layers.
The token is fixed for the lifetime of the port.
- response
tokenabsent if this port does not participate in power management. - response
tokenmust havezx.Rights.DUPLICATE.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".