pub struct Bytes(/* private fields */);
Expand description
Blob of Bytes. Right now it is backed by a Vec<u8>
.
But if this becomes a bottleneck we should back it with a custom allocator.
Implementations§
Source§impl Bytes
impl Bytes
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn get(&self, i: usize) -> u8
pub fn slice(&self, p: usize, q: usize) -> &[u8] ⓘ
pub fn push_byte(&mut self, byte: u8)
pub fn push_bytes(&mut self, bytes: Self)
pub fn push_slice(&mut self, bytes: &[u8])
pub fn push_string(&mut self, string: String)
pub fn push_str(&mut self, str: &str)
pub fn clear(&mut self)
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Ord for Bytes
impl Ord for Bytes
Source§impl PartialOrd for Bytes
impl PartialOrd for Bytes
impl Eq for Bytes
impl StructuralPartialEq for Bytes
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.