Struct buffertk::LengthFree

source ·
pub struct LengthFree<'a, P: Packable> { /* private fields */ }
Expand description

A type that packs a slice of objects by concatenating their packed representations. Does not prepend a length.

Trait Implementations§

source§

impl<'a, P: Packable> Packable for LengthFree<'a, P>

source§

fn pack_sz(&self) -> usize

pack_sz returns the number of bytes required to serialize the Packable object.
source§

fn pack(&self, out: &mut [u8])

pack fills in the buffer out with the packed binary representation of the Packable object. The implementor is responsible to ensure that out is exactly pack_sz() bytes and implementations are encouraged to assert this. Read more
source§

fn stream<W: Write>(&self, writer: &mut W) -> Result<usize, Error>
where Self: Sized, for<'a> &'a Self: Packable,

stream writes the object to the provided writer using the same representation that would be used in a call to pack. The implementor is responsible for making sure that the number of bytes written is exactly equal to the number of required bytes. Read more

Auto Trait Implementations§

§

impl<'a, P> RefUnwindSafe for LengthFree<'a, P>
where P: RefUnwindSafe,

§

impl<'a, P> Send for LengthFree<'a, P>
where P: Sync,

§

impl<'a, P> Sync for LengthFree<'a, P>
where P: Sync,

§

impl<'a, P> Unpin for LengthFree<'a, P>

§

impl<'a, P> UnwindSafe for LengthFree<'a, P>
where P: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.