#[repr(C)]pub struct VirtqMsgHeader {
pub kind: u8,
pub flags: u8,
pub req_id: u16,
pub payload_len: u32,
}Expand description
Wire header for all virtqueue messages
Fields§
§kind: u8Discriminates the message type.
flags: u8Per-message flags (see MsgFlags).
req_id: u16Caller-assigned correlation ID. Responses echo the request’s ID.
payload_len: u32Byte length of the payload following this header in this descriptor.
Implementations§
Source§impl VirtqMsgHeader
impl VirtqMsgHeader
pub const SIZE: usize
Sourcepub const fn new(kind: MsgKind, req_id: u16, payload_len: u32) -> Self
pub const fn new(kind: MsgKind, req_id: u16, payload_len: u32) -> Self
Create a new message header with no flags set.
Sourcepub const fn with_flags(
kind: MsgKind,
flags: MsgFlags,
req_id: u16,
payload_len: u32,
) -> Self
pub const fn with_flags( kind: MsgKind, flags: MsgFlags, req_id: u16, payload_len: u32, ) -> Self
Create a new header with flags.
Sourcepub const fn has_more(&self) -> bool
pub const fn has_more(&self) -> bool
Returns true if MsgFlags::MORE is set, indicating more
descriptors follow for this message.
Trait Implementations§
Source§impl Clone for VirtqMsgHeader
impl Clone for VirtqMsgHeader
Source§fn clone(&self) -> VirtqMsgHeader
fn clone(&self) -> VirtqMsgHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for VirtqMsgHeader
Source§impl Debug for VirtqMsgHeader
impl Debug for VirtqMsgHeader
impl Pod for VirtqMsgHeader
Auto Trait Implementations§
impl Freeze for VirtqMsgHeader
impl RefUnwindSafe for VirtqMsgHeader
impl Send for VirtqMsgHeader
impl Sync for VirtqMsgHeader
impl Unpin for VirtqMsgHeader
impl UnsafeUnpin for VirtqMsgHeader
impl UnwindSafe for VirtqMsgHeader
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.