Skip to main content

DeviceLocalServerHandler

Trait DeviceLocalServerHandler 

Source
pub trait DeviceLocalServerHandler<___T: Transport = Channel> {
    // Required methods
    fn get_info(
        &mut self,
        responder: Responder<GetInfo, ___T>,
    ) -> impl Future<Output = ()>;
    fn open_session(
        &mut self,
        request: Request<OpenSession, ___T>,
        responder: Responder<OpenSession, ___T>,
    ) -> impl Future<Output = ()>;
    fn get_port(
        &mut self,
        request: Request<GetPort, ___T>,
    ) -> impl Future<Output = ()>;
    fn get_port_watcher(
        &mut self,
        request: Request<GetPortWatcher, ___T>,
    ) -> impl Future<Output = ()>;
    fn clone(
        &mut self,
        request: Request<Clone, ___T>,
    ) -> impl Future<Output = ()>;
}
Expand description

A server handler for the Device protocol.

See Device for more details.

Required Methods§

Source

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

Obtain information about device

  • response info device information.
Source

fn open_session( &mut self, request: Request<OpenSession, ___T>, responder: Responder<OpenSession, ___T>, ) -> impl Future<Output = ()>

Opens a new session with the network device.

  • request session_name is used as a debugging label attached to this session.
  • request session_info contains the necessary information to setup the session’s data exchange.
  • response session a handle to control the session.
  • response fifos data-plane FIFOs attached to the session.
  • error ZX_ERR_NOT_SUPPORTED if session_info contains not supported frame types or descriptors set up.
  • error ZX_ERR_INVALID_ARGS if session_info is missing fields or contains invalid information.
  • error ZX_ERR_INTERNAL if the data VMO is rejected by the underlying device.
Source

fn get_port( &mut self, request: Request<GetPort, ___T>, ) -> impl Future<Output = ()>

Connects to a port the given id.

  • request id port to connect to.
  • request port server end of port channel.

port is closed with a ZX_ERR_NOT_FOUND epitaph if no port with id exists.

Source

fn get_port_watcher( &mut self, request: Request<GetPortWatcher, ___T>, ) -> impl Future<Output = ()>

Connects a PortWatcher to this device.

  • request watcher server end of watcher channel.
Source

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

Establishes a new connection to this device.

  • request device the server end for the new connection.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<___H, ___T> DeviceLocalServerHandler<___T> for Local<___H>
where ___H: DeviceServerHandler<___T>, ___T: Transport,

Source§

async fn get_info(&mut self, responder: Responder<GetInfo, ___T>)

Source§

async fn open_session( &mut self, request: Request<OpenSession, ___T>, responder: Responder<OpenSession, ___T>, )

Source§

async fn get_port(&mut self, request: Request<GetPort, ___T>)

Source§

async fn get_port_watcher(&mut self, request: Request<GetPortWatcher, ___T>)

Source§

async fn clone(&mut self, request: Request<Clone, ___T>)

Implementors§