pub struct Bytes<'a> { /* private fields */ }
Expand description
A cursor over a slice of bytes.
Implementations§
Source§impl<'a> Bytes<'a>
impl<'a> Bytes<'a>
Sourcepub const fn from_slice(bytes: &'a [u8]) -> Self
pub const fn from_slice(bytes: &'a [u8]) -> Self
Returns a new cursor over a slice of bytes.
Sourcepub const fn into_inner(self) -> &'a [u8] ⓘ
pub const fn into_inner(self) -> &'a [u8] ⓘ
Consumes the Bytes
and returns the underlying data.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Bytes<'a>
impl<'a> RefUnwindSafe for Bytes<'a>
impl<'a> Send for Bytes<'a>
impl<'a> Sync for Bytes<'a>
impl<'a> Unpin for Bytes<'a>
impl<'a> UnwindSafe for Bytes<'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