pub struct Bytes {
inner: Bytes,
}Expand description
Immutable, cheaply cloneable byte container. .
Fields§
§inner: BytesImplementations§
Source§impl Bytes
impl Bytes
Sourcepub fn from_slice(data: &[u8]) -> Self
pub fn from_slice(data: &[u8]) -> Self
Build from a slice (copies).
Sourcepub(crate) fn into_inner(self) -> Bytes
pub(crate) fn into_inner(self) -> Bytes
Consume into the underlying bytes::Bytes. For interop with crates
that speak the bytes API natively.
Sourcepub(crate) fn from_inner(inner: Bytes) -> Self
pub(crate) fn from_inner(inner: Bytes) -> Self
Wrap an existing bytes::Bytes without copying.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Bytes
impl RefUnwindSafe for Bytes
impl Send for Bytes
impl Sync for Bytes
impl Unpin for Bytes
impl UnsafeUnpin for Bytes
impl UnwindSafe for Bytes
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