pub struct RawBytes<B: ByteSlice>(/* private fields */);Expand description
Newtype-wrapped buffers for use in Header view-types.
Trait Implementations§
Source§impl<B: ByteSlice> Emit for RawBytes<B>
impl<B: ByteSlice> Emit for RawBytes<B>
Source§fn emit_raw<V: ByteSliceMut>(&self, buf: V) -> usize
fn emit_raw<V: ByteSliceMut>(&self, buf: V) -> usize
Writes this packet’s contents into a target buffer without
performing length checks. Read more
Source§fn needs_emit(&self) -> bool
fn needs_emit(&self) -> bool
Returns whether this packet needs a full re-emit, and
has not been simply modified in-place. Read more
Source§fn emit<V: ByteSliceMut>(&self, buf: V) -> ParseResult<usize>
fn emit<V: ByteSliceMut>(&self, buf: V) -> ParseResult<usize>
Writes this packet’s contents into a target buffer.
Source§fn emit_prefix<V: SplitByteSliceMut>(&self, buf: V) -> ParseResult<V>
fn emit_prefix<V: SplitByteSliceMut>(&self, buf: V) -> ParseResult<V>
Writes this packet’s contents into the start of a target buffer.
Source§fn emit_suffix<V: SplitByteSliceMut>(&self, buf: V) -> ParseResult<V>
fn emit_suffix<V: SplitByteSliceMut>(&self, buf: V) -> ParseResult<V>
Writes this packet’s contents at the end of a target buffer.
Source§fn emit_uninit(&self, buf: &mut [MaybeUninit<u8>]) -> ParseResult<usize>where
Self: EmitDoesNotRelyOnBufContents,
fn emit_uninit(&self, buf: &mut [MaybeUninit<u8>]) -> ParseResult<usize>where
Self: EmitDoesNotRelyOnBufContents,
Writes this packet’s contents into uninitialised memory.
Source§fn emit_vec(&self) -> Vec<u8>where
Self: EmitDoesNotRelyOnBufContents,
fn emit_vec(&self) -> Vec<u8>where
Self: EmitDoesNotRelyOnBufContents,
Writes this packet’s contents into a newly allocated
Vec of length
Header::packet_length, without zero-filling the contents. Read moreSource§impl<B: ByteSlice> HeaderLen for RawBytes<B>
impl<B: ByteSlice> HeaderLen for RawBytes<B>
Source§const MINIMUM_LENGTH: usize = 0usize
const MINIMUM_LENGTH: usize = 0usize
The minimum number of bytes a packet of this kind occupies
when serialised.
Source§fn packet_length(&self) -> usize
fn packet_length(&self) -> usize
The number of bytes which this packet would occupy when serialised. Read more
impl<B: ByteSlice> EmitDoesNotRelyOnBufContents for RawBytes<B>
Auto Trait Implementations§
impl<B> Freeze for RawBytes<B>where
B: Freeze,
impl<B> RefUnwindSafe for RawBytes<B>where
B: RefUnwindSafe,
impl<B> Send for RawBytes<B>where
B: Send,
impl<B> Sync for RawBytes<B>where
B: Sync,
impl<B> Unpin for RawBytes<B>where
B: Unpin,
impl<B> UnwindSafe for RawBytes<B>where
B: 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