pub enum ZeroCopyFrame<'a> {
Data {
stream_id: u32,
data: &'a [u8],
fin: bool,
},
}Expand description
Zero-copy view of a data frame (borrows from parse buffer).
Use in batch decode paths; convert to Frame with ZeroCopyFrame::to_owned when crossing task boundaries.
Variants§
Implementations§
Source§impl ZeroCopyFrame<'_>
impl ZeroCopyFrame<'_>
Sourcepub fn to_owned(self) -> Frame
pub fn to_owned(self) -> Frame
Convert to owned Frame (copies data into bytes::Bytes).
Trait Implementations§
Source§impl<'a> Clone for ZeroCopyFrame<'a>
impl<'a> Clone for ZeroCopyFrame<'a>
Source§fn clone(&self) -> ZeroCopyFrame<'a>
fn clone(&self) -> ZeroCopyFrame<'a>
Returns a duplicate 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<'a> Debug for ZeroCopyFrame<'a>
impl<'a> Debug for ZeroCopyFrame<'a>
impl<'a> Copy for ZeroCopyFrame<'a>
Auto Trait Implementations§
impl<'a> Freeze for ZeroCopyFrame<'a>
impl<'a> RefUnwindSafe for ZeroCopyFrame<'a>
impl<'a> Send for ZeroCopyFrame<'a>
impl<'a> Sync for ZeroCopyFrame<'a>
impl<'a> Unpin for ZeroCopyFrame<'a>
impl<'a> UnsafeUnpin for ZeroCopyFrame<'a>
impl<'a> UnwindSafe for ZeroCopyFrame<'a>
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