Struct nested::Nested [−][src]
pub struct Nested<T> { /* fields omitted */ }
Expand description
A two dimensional collection with minimal allocation
T
is the owning underlying container.
For instance, it behaves similarly to Vec<Vec<T>>
or Vec<String>
but
only has 2 internal buffers.
It can be used:
- on your own collection as long as it implements the
Collection
trait. - like a sparse vector
- when you need to collect (move ownership) many
String
s orVec<T>
s
Implementations
Creates a new Nested
with given capacity.
len: the expected item count size: the expected total size taken by all items
Removes the last element from a Nested
and returns it, or None if it is empty.
Extend with count
empty elements
Shortens the Nested
, keeping the first len elements and dropping the rest.
If len is greater than the vector’s current length, this has no effect.
Note that this method has no effect on the allocated capacity of the vector.
Truncates this Nested
, removing all contents.
While this means the Nested
will have a length of zero, it does not touch its capacity.
Returns a shared reference to the output at this location, if in bounds.
Returns a reference to the underlying indices.
Each index represents the start of each logical vector beyond the first one.
Returns a reference to the underlying data.
The data is stored contiguously.
Returns an iterator over Nested
elements.
Trait Implementations
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Creates a value from an iterator. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Nested<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Nested<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more