Skip to main content

PortServerHandler

Trait PortServerHandler 

Source
pub trait PortServerHandler<___T: Transport = Channel> {
    // Required methods
    fn get_info(
        &mut self,
        responder: Responder<GetInfo, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn get_status(
        &mut self,
        responder: Responder<GetStatus, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn get_status_watcher(
        &mut self,
        request: Request<GetStatusWatcher, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn get_mac(
        &mut self,
        request: Request<GetMac, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn get_device(
        &mut self,
        request: Request<GetDevice, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn clone(
        &mut self,
        request: Request<Clone, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn get_counters(
        &mut self,
        responder: Responder<GetCounters, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn get_diagnostics(
        &mut self,
        request: Request<GetDiagnostics, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn get_identity(
        &mut self,
        responder: Responder<GetIdentity, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn get_power_dependency_token(
        &mut self,
        responder: Responder<GetPowerDependencyToken, ___T>,
    ) -> impl Future<Output = ()> + Send;
}
Expand description

A server handler for the Port protocol.

See Port for more details.

Required Methods§

Source

fn get_info( &mut self, responder: Responder<GetInfo, ___T>, ) -> impl Future<Output = ()> + Send

Obtain information about port.

  • response info port information.
Source

fn get_status( &mut self, responder: Responder<GetStatus, ___T>, ) -> impl Future<Output = ()> + Send

Obtain the operating port status.

  • response status snapshot of port’s current status.
Source

fn get_status_watcher( &mut self, request: Request<GetStatusWatcher, ___T>, ) -> impl Future<Output = ()> + Send

Connects to a StatusWatcher to observe port status changes.

  • request watcher handle to the status watcher.
  • request buffer the number of status changes that the client requests to be stored by StatusWatcher. Values are capped at MAX_STATUS_BUFFER. A value of 0 or 1 causes the StatusWatcher to 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. If StatusWatcher’s internal queue is filled and new status changes occur, the oldest samples will be dropped to make room for new ones.
Source

fn get_mac( &mut self, request: Request<GetMac, ___T>, ) -> impl Future<Output = ()> + Send

Connects to a MacAddressing associated with the port.

  • request mac mac handle. Closed with ZX_ERR_NOT_SUPPORTED if this port does not support mac addressing.
Source

fn get_device( &mut self, request: Request<GetDevice, ___T>, ) -> impl Future<Output = ()> + Send

Connects to the Device this port belongs to.

  • request device grants access to the parent device.
Source

fn clone( &mut self, request: Request<Clone, ___T>, ) -> impl Future<Output = ()> + Send

Establishes a new connection to this port.

  • request port the server end for the new connection.
Source

fn get_counters( &mut self, responder: Responder<GetCounters, ___T>, ) -> impl Future<Output = ()> + Send

Retrieves a snapshot of traffic counters on this port.

Source

fn get_diagnostics( &mut self, request: Request<GetDiagnostics, ___T>, ) -> impl Future<Output = ()> + Send

Grants access to Diagnostics for this port.

  • request diagnostics grants access to diagnostics information.
Source

fn get_identity( &mut self, responder: Responder<GetIdentity, ___T>, ) -> impl Future<Output = ()> + Send

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.

Source

fn get_power_dependency_token( &mut self, responder: Responder<GetPowerDependencyToken, ___T>, ) -> impl Future<Output = ()> + Send

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 token absent if this port does not participate in power management.
  • response token must have zx.Rights.DUPLICATE.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§