pub trait NetworkPortLocalServerHandler<___T: Transport = DriverChannel> {
// 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 set_active(
&mut self,
request: Request<SetActive, ___T>,
) -> impl Future<Output = ()>;
fn get_mac(
&mut self,
responder: Responder<GetMac, ___T>,
) -> impl Future<Output = ()>;
fn removed(&mut self) -> impl Future<Output = ()>;
fn get_power_dependency_token(
&mut self,
responder: Responder<GetPowerDependencyToken, ___T>,
) -> impl Future<Output = ()>;
}Expand description
A server handler for the NetworkPort protocol.
See NetworkPort 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 = ()>
Gets information about the port.
Port information must not change over the port’s lifetime.
- 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 = ()>
Gets operational status of the port.
Changes to operational status must be reported via
[NetworkDeviceIfc.StatusChanged]
- response
statussnapshot of port’s operational status.
Sourcefn set_active(
&mut self,
request: Request<SetActive, ___T>,
) -> impl Future<Output = ()>
fn set_active( &mut self, request: Request<SetActive, ___T>, ) -> impl Future<Output = ()>
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
activetrueif port has sessions attached to it,falseotherwise.
Sourcefn get_mac(
&mut self,
responder: Responder<GetMac, ___T>,
) -> impl Future<Output = ()>
fn get_mac( &mut self, responder: Responder<GetMac, ___T>, ) -> impl Future<Output = ()>
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_ifcmac addressing handle.
Sourcefn removed(&mut self) -> impl Future<Output = ()>
fn removed(&mut self) -> impl Future<Output = ()>
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.
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".