#[repr(C)]
pub struct Bytes { /* fields omitted */ }
Expand description
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)
}
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
The resulting type after dereferencing.
Mutably dereferences the value.
Deserialize this value from the given Serde deserializer. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
Serialize this value into the given Serde serializer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more