Struct vmm_vhost::frontend_client::FrontendClient
source · pub struct FrontendClient {
sock: Connection<BackendReq>,
reply_ack_negotiated: bool,
error: Option<i32>,
}
Expand description
Client for a vhost-user frontend. Allows a backend to send requests to the frontend.
Fields§
§sock: Connection<BackendReq>
§reply_ack_negotiated: bool
§error: Option<i32>
Implementations§
source§impl FrontendClient
impl FrontendClient
sourcepub fn new(ep: Connection<BackendReq>) -> Self
pub fn new(ep: Connection<BackendReq>) -> Self
Create a new instance from the given connection.
fn send_message<T>(
&mut self,
request: BackendReq,
msg: &T,
fds: Option<&[RawDescriptor]>
) -> HandlerResult<u64>where
T: AsBytes,
fn wait_for_reply( &mut self, hdr: &VhostUserMsgHeader<BackendReq> ) -> Result<u64>
sourcepub fn set_reply_ack_flag(&mut self, enable: bool)
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 backend to frontend request
message.
sourcepub fn set_failed(&mut self, error: i32)
pub fn set_failed(&mut self, error: i32)
Mark connection as failed with specified error code.
Trait Implementations§
source§impl Frontend for FrontendClient
impl Frontend for FrontendClient
source§fn shmem_map(
&mut self,
req: &VhostUserShmemMapMsg,
fd: &dyn AsRawDescriptor
) -> HandlerResult<u64>
fn shmem_map( &mut self, req: &VhostUserShmemMapMsg, fd: &dyn AsRawDescriptor ) -> HandlerResult<u64>
Handle shared memory region mapping requests.
source§fn shmem_unmap(&mut self, req: &VhostUserShmemUnmapMsg) -> HandlerResult<u64>
fn shmem_unmap(&mut self, req: &VhostUserShmemUnmapMsg) -> HandlerResult<u64>
Handle shared memory region unmapping requests.
source§fn handle_config_change(&mut self) -> HandlerResult<u64>
fn handle_config_change(&mut self) -> HandlerResult<u64>
Handle config change requests.
source§fn gpu_map(
&mut self,
req: &VhostUserGpuMapMsg,
descriptor: &dyn AsRawDescriptor
) -> HandlerResult<u64>
fn gpu_map( &mut self, req: &VhostUserGpuMapMsg, descriptor: &dyn AsRawDescriptor ) -> HandlerResult<u64>
Handle GPU shared memory region mapping requests.
source§fn external_map(&mut self, req: &VhostUserExternalMapMsg) -> HandlerResult<u64>
fn external_map(&mut self, req: &VhostUserExternalMapMsg) -> HandlerResult<u64>
Handle external memory region mapping requests.
Auto Trait Implementations§
impl !RefUnwindSafe for FrontendClient
impl Send for FrontendClient
impl !Sync for FrontendClient
impl Unpin for FrontendClient
impl UnwindSafe for FrontendClient
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more