Trait Notifier

Source
pub trait Notifier: Send {
    // Required methods
    fn notify(&mut self, offer_id: OfferId, action: Action);
    fn forward_unhandled(&mut self, request: InitiateContactRequest);
    fn modify_connection(
        &mut self,
        request: ModifyConnectionRequest,
    ) -> Result<()>;
    fn send_message(
        &mut self,
        message: &OutgoingMessage,
        target: MessageTarget,
    ) -> bool;
    fn notify_hvsock(&mut self, request: &HvsockConnectRequest);
    fn reset_complete(&mut self);
    fn unload_complete(&mut self);

    // Provided method
    fn inspect(
        &self,
        version: Option<VersionInfo>,
        offer_id: OfferId,
        req: Request<'_>,
    ) { ... }
}
Expand description

Trait for sending requests to devices and the guest.

Required Methods§

Source

fn notify(&mut self, offer_id: OfferId, action: Action)

Requests a channel action.

Source

fn forward_unhandled(&mut self, request: InitiateContactRequest)

Forward an unhandled InitiateContact request to an external server.

Source

fn modify_connection(&mut self, request: ModifyConnectionRequest) -> Result<()>

Update server state with information from the connection, and optionally notify the relay.

N.B. If ModifyConnectionRequest::notify_relay is true and the function does not return an error, the server expects Server::complete_modify_connection() to be called, regardless of whether or not there is a relay.

Source

fn send_message( &mut self, message: &OutgoingMessage, target: MessageTarget, ) -> bool

Sends a synic message to the guest. Returns true if the message was sent, and false if it must be retried.

Source

fn notify_hvsock(&mut self, request: &HvsockConnectRequest)

Used to signal the hvsocket handler that there is a new connection request.

Source

fn reset_complete(&mut self)

Notifies that a requested reset is complete.

Source

fn unload_complete(&mut self)

Notifies that a guest-requested unload is complete.

Provided Methods§

Source

fn inspect( &self, version: Option<VersionInfo>, offer_id: OfferId, req: Request<'_>, )

Inspects a channel.

Implementors§