Skip to main content

NetworkPortServerHandler

Trait NetworkPortServerHandler 

Source
pub trait NetworkPortServerHandler<___T: Transport = DriverChannel> {
    // 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 set_active(
        &mut self,
        request: Request<SetActive, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn get_mac(
        &mut self,
        responder: Responder<GetMac, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn removed(&mut self) -> 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 NetworkPort protocol.

See NetworkPort for more details.

Required Methods§

Source

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

Gets information about the port.

Port information must not change over the port’s lifetime.

  • response info port information.
Source

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

Gets operational status of the port.

Changes to operational status must be reported via [NetworkDeviceIfc.StatusChanged]

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

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

Notifies the port that there are sessions interested in it.

An active port has sessions attached to it. Implementations may employ power saving or other strategies on disabled ports. Implementations that do employ such strategies:

  • should not report inbound frames for inactive ports;
  • must return errors for outbound frames destined to inactive ports.

All ports are inactive on creation.

  • request active true if port has sessions attached to it, false otherwise.
Source

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

Gets an interface to the MAC addressing layer of the port.

Ports that do not support MAC addressing must return an empty interface.

  • response mac_ifc mac addressing handle.
Source

fn removed(&mut self) -> impl Future<Output = ()> + Send

Notifies this port has been removed from the interface.

Resources associated with the port must only be freed upon receiving the Removed call. Note that Removed will ONLY be called if AddPort has returned and indicated success. If AddPort fails this will not be called, check the return status of AddPort instead.

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.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§