pub struct StableVec<T>(_);
A vector container that makes sure that its items are hashed in a stable
order.
Returns the number of elements the vector can hold without
reallocating.
let vec: Vec<i32> = Vec::with_capacity(10);
assert_eq!(vec.capacity(), 10);
Extracts a slice containing the entire vector.
Equivalent to &s[..]
.
use std::io::{self, Write};
let buffer = vec![1, 2, 3, 5, 8];
io::sink().write(buffer.as_slice()).unwrap();
Returns the number of elements in the vector, also referred to
as its 'length'.
let a = vec![1, 2, 3];
assert_eq!(a.len(), 3);
Returns true
if the vector contains no elements.
let mut v = Vec::new();
assert!(v.is_empty());
v.push(1);
assert!(!v.is_empty());
type Target = Vec<T>
The resulting type after dereferencing.
type Error = !
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S
is the encoder/decoder state type, T
is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more