pub struct Tokens<'a>(pub Vec<Token<'a>>);
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());
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Converts the given value to a String
. Read more
🔬 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
🔬 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