pub struct VsockHeader {
pub src_cid: u64,
pub dst_cid: u64,
pub src_port: u32,
pub dst_port: u32,
pub len: u32,
pub type_: u16,
pub op: VsockOp,
pub flags: u32,
pub buf_alloc: u32,
pub fwd_cnt: u32,
}Expand description
Wire-format packet header (44 bytes per spec § 5.10.6).
Fields§
§src_cid: u64Source CID.
dst_cid: u64Destination CID.
src_port: u32Source port.
dst_port: u32Destination port.
len: u32Payload length.
type_: u16Packet type (e.g. TYPE_STREAM).
op: VsockOpOperation.
flags: u32Flags (op-specific bitmap).
buf_alloc: u32Receiver advertised buffer size.
fwd_cnt: u32Receiver forwarded byte count.
Implementations§
Source§impl VsockHeader
impl VsockHeader
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, VsockParseError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, VsockParseError>
Trait Implementations§
Source§impl Clone for VsockHeader
impl Clone for VsockHeader
Source§fn clone(&self) -> VsockHeader
fn clone(&self) -> VsockHeader
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 moreSource§impl Debug for VsockHeader
impl Debug for VsockHeader
impl Copy for VsockHeader
Auto Trait Implementations§
impl Freeze for VsockHeader
impl RefUnwindSafe for VsockHeader
impl Send for VsockHeader
impl Sync for VsockHeader
impl Unpin for VsockHeader
impl UnsafeUnpin for VsockHeader
impl UnwindSafe for VsockHeader
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