Struct vmm_vhost::message::VhostUserMsgHeader
source · #[repr(C, packed(1))]pub struct VhostUserMsgHeader<R: Req> {
request: u32,
flags: u32,
size: u32,
_r: PhantomData<R>,
}
Expand description
Common message header for vhost-user requests and replies. A vhost-user message consists of 3 header fields and an optional payload. All numbers are in the machine native byte order.
Fields§
§request: u32
§flags: u32
§size: u32
§_r: PhantomData<R>
Implementations§
source§impl<R: Req> VhostUserMsgHeader<R>
impl<R: Req> VhostUserMsgHeader<R>
sourcepub fn new(request: R, flags: u32, size: u32) -> Self
pub fn new(request: R, flags: u32, size: u32) -> Self
Create a new instance of VhostUserMsgHeader
.
pub fn into_raw(self) -> [u32; 3]
pub fn from_raw(raw: [u32; 3]) -> Self
sourcepub fn get_version(&self) -> u32
pub fn get_version(&self) -> u32
Get message version number.
sourcepub fn set_version(&mut self, ver: u32)
pub fn set_version(&mut self, ver: u32)
Set message version number.
sourcepub fn is_need_reply(&self) -> bool
pub fn is_need_reply(&self) -> bool
Check whether reply for this message is requested.
sourcepub fn set_need_reply(&mut self, need_reply: bool)
pub fn set_need_reply(&mut self, need_reply: bool)
Mark that reply for this message is needed.
sourcepub fn is_reply_for(&self, req: &VhostUserMsgHeader<R>) -> bool
pub fn is_reply_for(&self, req: &VhostUserMsgHeader<R>) -> bool
Check whether it’s the reply message for the request req
.
Trait Implementations§
source§impl<R: Req> Clone for VhostUserMsgHeader<R>
impl<R: Req> Clone for VhostUserMsgHeader<R>
source§fn clone(&self) -> VhostUserMsgHeader<R>
fn clone(&self) -> VhostUserMsgHeader<R>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<R: Req> Debug for VhostUserMsgHeader<R>
impl<R: Req> Debug for VhostUserMsgHeader<R>
source§impl<R: Req> Default for VhostUserMsgHeader<R>
impl<R: Req> Default for VhostUserMsgHeader<R>
source§impl<R: Req> PartialEq for VhostUserMsgHeader<R>
impl<R: Req> PartialEq for VhostUserMsgHeader<R>
source§impl<T: Req> VhostUserMsgValidator for VhostUserMsgHeader<T>
impl<T: Req> VhostUserMsgValidator for VhostUserMsgHeader<T>
impl<R: Copy + Req> Copy for VhostUserMsgHeader<R>
Auto Trait Implementations§
impl<R> Freeze for VhostUserMsgHeader<R>
impl<R> RefUnwindSafe for VhostUserMsgHeader<R>where
R: RefUnwindSafe,
impl<R> Send for VhostUserMsgHeader<R>
impl<R> Sync for VhostUserMsgHeader<R>
impl<R> Unpin for VhostUserMsgHeader<R>where
R: Unpin,
impl<R> UnwindSafe for VhostUserMsgHeader<R>where
R: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)