[−][src]Struct serde_bytes::Bytes
Wrapper around &[u8]
to serialize and deserialize efficiently.
ⓘThis code runs with edition 2018
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) }
Methods
impl<'a> Bytes<'a>
[src][−]
Trait Implementations
impl<'a> Clone for Bytes<'a>
[src][+]
impl<'a> Copy for Bytes<'a>
[src]
impl<'a> Debug for Bytes<'a>
[src][+]
impl<'a> Deref for Bytes<'a>
[src][+]
impl<'a, 'de: 'a> Deserialize<'de> for Bytes<'a>
[src][+]
impl<'a> Eq for Bytes<'a>
[src]
impl<'a> From<&'a [u8]> for Bytes<'a>
[src][+]
impl<'a> From<Bytes<'a>> for &'a [u8]
[src][+]
impl<'a> Hash for Bytes<'a>
[src][+]
impl<'de, 'a, E> IntoDeserializer<'de, E> for Bytes<'a> where
E: Error,
[src][+]
E: Error,
impl<'a> Ord for Bytes<'a>
[src][+]
impl<'a> PartialEq<Bytes<'a>> for Bytes<'a>
[src][+]
impl<'a> PartialOrd<Bytes<'a>> for Bytes<'a>
[src][+]
impl<'a> Serialize for Bytes<'a>
[src][+]
impl<'a> StructuralEq for Bytes<'a>
[src]
impl<'a> StructuralPartialEq for Bytes<'a>
[src]
Auto Trait Implementations
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
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,