Type Alias devices::virtio::vhost_user_frontend::handler::BackendReqHandler

source ·
pub(crate) type BackendReqHandler = FrontendServer<BackendReqHandlerImpl>;

Aliased Type§

struct BackendReqHandler { /* private fields */ }

Implementations

source§

impl<S> FrontendServer<S>
where S: Frontend,

source

pub fn set_reply_ack_flag(&mut self, enable: bool)

Set the negotiation state of the VHOST_USER_PROTOCOL_F_REPLY_ACK protocol feature.

When the VHOST_USER_PROTOCOL_F_REPLY_ACK protocol feature has been negotiated, the “REPLY_ACK” flag will be set in the message header for every request message.

source

pub fn frontend_mut(&mut self) -> &mut S

Get the underlying frontend

source

pub fn handle_request(&mut self) -> Result<(), Error>

Process the next received request.

The caller needs to:

  • serialize calls to this function
  • decide what to do when errer happens
  • optional recover from failure
source§

impl<S> FrontendServer<S>
where S: Frontend,

source

pub fn with_stream( backend: S, ) -> Result<(FrontendServer<S>, SafeDescriptor), Error>

Create a FrontendServer that uses a Unix stream internally.

The returned SafeDescriptor is the client side of the stream and should be sent to the backend using BackendClient::set_slave_request_fd().

Trait Implementations

source§

impl<S> AsRawDescriptor for FrontendServer<S>
where S: Frontend,

source§

fn as_raw_descriptor(&self) -> i32

Returns the underlying raw descriptor. Read more
source§

impl<S> ReadNotifier for FrontendServer<S>
where S: Frontend,

source§

fn get_read_notifier(&self) -> &dyn AsRawDescriptor

Gets a descriptor that can be used in EventContext to wait for events to be available (e.g. to avoid receive_events blocking).