Struct serde_bytes::Bytes [−][src]
Wrapper around [u8]
to serialize and deserialize efficiently.
use std::collections::HashMap; use std::io; use serde_bytes::Bytes; fn print_encoded_cache() -> bincode::Result<()> { let mut cache = HashMap::new(); cache.insert(3, Bytes::new(b"three")); cache.insert(2, Bytes::new(b"two")); cache.insert(1, Bytes::new(b"one")); bincode::serialize_into(&mut io::stdout(), &cache) }
Implementations
impl Bytes
[src]
Trait Implementations
impl AsMut<[u8]> for Bytes
[src]
impl AsRef<[u8]> for Bytes
[src]
impl Borrow<Bytes> for ByteBuf
[src]
impl BorrowMut<Bytes> for ByteBuf
[src]
fn borrow_mut(&mut self) -> &mut Bytes
[src]
impl Debug for Bytes
[src]
impl<'a> Default for &'a Bytes
[src]
impl Deref for Bytes
[src]
impl DerefMut for Bytes
[src]
impl<'de: 'a, 'a> Deserialize<'de> for &'a Bytes
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl<'a, 'de: 'a> Deserialize<'de> for &'a Bytes
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Eq for Bytes
[src]
impl Hash for Bytes
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> IntoIterator for &'a Bytes
[src]
type Item = &'a u8
The type of the elements being iterated over.
type IntoIter = <&'a [u8] as IntoIterator>::IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a> IntoIterator for &'a mut Bytes
[src]
type Item = &'a mut u8
The type of the elements being iterated over.
type IntoIter = <&'a mut [u8] as IntoIterator>::IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl Ord for Bytes
[src]
fn cmp(&self, other: &Bytes) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<Rhs: ?Sized> PartialEq<Rhs> for Bytes where
Rhs: AsRef<[u8]>,
[src]
Rhs: AsRef<[u8]>,
impl<Rhs: ?Sized> PartialOrd<Rhs> for Bytes where
Rhs: AsRef<[u8]>,
[src]
Rhs: AsRef<[u8]>,