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§
Sourcefn forward_unhandled(&mut self, request: InitiateContactRequest)
fn forward_unhandled(&mut self, request: InitiateContactRequest)
Forward an unhandled InitiateContact request to an external server.
Sourcefn modify_connection(&mut self, request: ModifyConnectionRequest) -> Result<()>
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.
Sourcefn send_message(
&mut self,
message: &OutgoingMessage,
target: MessageTarget,
) -> bool
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.
Sourcefn notify_hvsock(&mut self, request: &HvsockConnectRequest)
fn notify_hvsock(&mut self, request: &HvsockConnectRequest)
Used to signal the hvsocket handler that there is a new connection request.
Sourcefn reset_complete(&mut self)
fn reset_complete(&mut self)
Notifies that a requested reset is complete.
Sourcefn unload_complete(&mut self)
fn unload_complete(&mut self)
Notifies that a guest-requested unload is complete.