pub struct FrameSlice<'frame> { /* private fields */ }
Expand description
A reference to a part of the frame.
Implementations§
Source§impl<'frame> FrameSlice<'frame>
impl<'frame> FrameSlice<'frame>
Sourcepub fn new(frame: &'frame Bytes) -> Self
pub fn new(frame: &'frame Bytes) -> Self
Creates a new FrameSlice from a reference of a Bytes object.
This method is exposed to allow writing deserialization tests for custom types.
Sourcepub fn as_slice_mut(&mut self) -> &mut &'frame [u8] ⓘ
pub fn as_slice_mut(&mut self) -> &mut &'frame [u8] ⓘ
Returns a mutable reference to the subslice.
Sourcepub fn as_original_frame_bytes(&self) -> &'frame Bytes
pub fn as_original_frame_bytes(&self) -> &'frame Bytes
Returns a reference to the Bytes object which encompasses the whole frame slice.
The Bytes object will usually be larger than the slice returned by FrameSlice::as_slice. If you wish to obtain a new Bytes object that points only to the subslice represented by the FrameSlice object, see FrameSlice::to_bytes.
Trait Implementations§
Source§impl<'frame> Clone for FrameSlice<'frame>
impl<'frame> Clone for FrameSlice<'frame>
Source§fn clone(&self) -> FrameSlice<'frame>
fn clone(&self) -> FrameSlice<'frame>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'frame> Debug for FrameSlice<'frame>
impl<'frame> Debug for FrameSlice<'frame>
Source§impl<'frame> From<FrameSlice<'frame>> for BytesSequenceIterator<'frame>
impl<'frame> From<FrameSlice<'frame>> for BytesSequenceIterator<'frame>
Source§fn from(slice: FrameSlice<'frame>) -> Self
fn from(slice: FrameSlice<'frame>) -> Self
Converts to this type from the input type.
impl<'frame> Copy for FrameSlice<'frame>
Auto Trait Implementations§
impl<'frame> Freeze for FrameSlice<'frame>
impl<'frame> RefUnwindSafe for FrameSlice<'frame>
impl<'frame> Send for FrameSlice<'frame>
impl<'frame> Sync for FrameSlice<'frame>
impl<'frame> Unpin for FrameSlice<'frame>
impl<'frame> UnwindSafe for FrameSlice<'frame>
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