#[repr(C, packed(1))]pub struct StreamChunk {
pub sequence: u32,
pub flags: u8,
pub len: u16,
}Expand description
Binary stream chunk - 7 bytes header
Fields§
§sequence: u32Sequence number for ordering
flags: u8Flags: FIRST=1, CONTINUE=2, LAST=4, ERROR=8
len: u16Chunk payload length
Implementations§
Source§impl StreamChunk
impl StreamChunk
Sourcepub fn continuation(sequence: u32, len: u16) -> Self
pub fn continuation(sequence: u32, len: u16) -> Self
Create a continuation chunk
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<&Self, DCPError>
pub fn from_bytes(bytes: &[u8]) -> Result<&Self, DCPError>
Parse from bytes
Sourcepub fn is_continuation(&self) -> bool
pub fn is_continuation(&self) -> bool
Check if this is a continuation chunk
Trait Implementations§
Source§impl Clone for StreamChunk
impl Clone for StreamChunk
Source§fn clone(&self) -> StreamChunk
fn clone(&self) -> StreamChunk
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 StreamChunk
Source§impl Debug for StreamChunk
impl Debug for StreamChunk
impl Eq for StreamChunk
Source§impl PartialEq for StreamChunk
impl PartialEq for StreamChunk
Source§fn eq(&self, other: &StreamChunk) -> bool
fn eq(&self, other: &StreamChunk) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StreamChunk
Auto Trait Implementations§
impl Freeze for StreamChunk
impl RefUnwindSafe for StreamChunk
impl Send for StreamChunk
impl Sync for StreamChunk
impl Unpin for StreamChunk
impl UnsafeUnpin for StreamChunk
impl UnwindSafe for StreamChunk
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