pub enum Bytes {
Empty,
Byte(u8),
Word([u8; 4]),
Bytes(Vec<u8>),
}
Expand description
A blob of bytes; optimized over byte and word.
Variantsยง
Implementationsยง
Sourceยงimpl Bytes
impl Bytes
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> Self
Construct a blob from raw bytes.
Sourcepub fn from_slice(b: &[u8]) -> Self
pub fn from_slice(b: &[u8]) -> Self
Construct a blob from a slice of bytes. Clones them.
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 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