Struct exocore_core::framing::sized::SizedFrame
source · 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>
impl<I: FrameReader> SizedFrame<I>
pub fn new(inner: I) -> Result<SizedFrame<I>, Error>
pub fn new_from_next_offset( inner: I, next_offset: usize ) -> Result<SizedFrame<I>, Error>
pub fn size(&self) -> usize
source§impl SizedFrame<Bytes>
impl SizedFrame<Bytes>
pub fn new_from_reader<R: Read>( reader: &mut R ) -> Result<SizedFrame<Bytes>, Error>
Trait Implementations§
source§impl<I: FrameReader + Clone> Clone for SizedFrame<I>
impl<I: FrameReader + Clone> Clone for SizedFrame<I>
source§impl<I: FrameReader> FrameReader for SizedFrame<I>
impl<I: FrameReader> FrameReader for SizedFrame<I>
type OwnedType = SizedFrame<Bytes>
source§fn exposed_data(&self) -> &[u8] ⓘ
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] ⓘ
fn whole_data(&self) -> &[u8] ⓘ
Data of the whole frame, not just the exposed data.
source§fn to_owned_frame(&self) -> Self::OwnedType
fn to_owned_frame(&self) -> Self::OwnedType
Converts the frame to a owned version (without lifetime)
source§fn whole_data_size(&self) -> usize
fn whole_data_size(&self) -> usize
Size of the whole data of the frame.
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> 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