pub struct SizedFrame<I: FrameReader> { /* private fields */ }
Expand description

Frame that encode the size of the underlying frame so that it can expose the exact data when decoding. The size is prepended and appended to support to support iteration in both directions.

Implementations§

source§

impl<I: FrameReader> SizedFrame<I>

source

pub fn new(inner: I) -> Result<SizedFrame<I>, Error>

source

pub fn new_from_next_offset( inner: I, next_offset: usize ) -> Result<SizedFrame<I>, Error>

source

pub fn size(&self) -> usize

source§

impl SizedFrame<Bytes>

Trait Implementations§

source§

impl<I: FrameReader + Clone> Clone for SizedFrame<I>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<I: FrameReader> FrameReader for SizedFrame<I>

§

type OwnedType = SizedFrame<Bytes>

source§

fn exposed_data(&self) -> &[u8]

Data exposed by this frame to inner frame. Ex: sized frame will expose the sized data without encoded size numbers
source§

fn whole_data(&self) -> &[u8]

Data of the whole frame, not just the exposed data.
source§

fn to_owned_frame(&self) -> Self::OwnedType

Converts the frame to a owned version (without lifetime)
source§

fn whole_data_size(&self) -> usize

Size of the whole data of the frame.
source§

fn copy_to<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Copy the frame into the given writer
source§

fn copy_into(&self, into: &mut [u8]) -> Result<usize, Error>

Copy the frame into the given slice

Auto Trait Implementations§

§

impl<I> RefUnwindSafe for SizedFrame<I>where I: RefUnwindSafe,

§

impl<I> Send for SizedFrame<I>where I: Send,

§

impl<I> Sync for SizedFrame<I>where I: Sync,

§

impl<I> Unpin for SizedFrame<I>where I: Unpin,

§

impl<I> UnwindSafe for SizedFrame<I>where I: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V