pub struct Dynamic<Container, S = Binary> { /* private fields */ }
Expand description
A dynamic version of Container
.
Implementations§
Source§impl<Container: Static, S: Strategy> Dynamic<Container, S>
impl<Container: Static, S: Strategy> Dynamic<Container, S>
Sourcepub fn with_unit_count(unit_count: usize) -> Self
pub fn with_unit_count(unit_count: usize) -> Self
A new container with a specified initial unit count.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Total size of the container.
It is calculated as a sum of partial lengths. Usually can be replaced without much hassle by a variable tracking insertions/deletions.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if there are no elements.
Warning: this function queries all the units. It’s much better to replace this function with a variable tracking insertions/deletions.
Sourcepub fn units(&self) -> Units<'_, Container> ⓘ
pub fn units(&self) -> Units<'_, Container> ⓘ
Iterator over all the partial containers. Shared-reference version.
Sourcepub fn units_mut(&mut self) -> UnitsMut<'_, Container> ⓘ
pub fn units_mut(&mut self) -> UnitsMut<'_, Container> ⓘ
Iterator over all the partial containers. Unique-reference version.
Sourcepub fn try_collect(self) -> Option<Container>
pub fn try_collect(self) -> Option<Container>
Collects all the partial containers into a single one.
Returns None
if there are no units.
Trait Implementations§
Source§impl<Container, S> IntoIterator for Dynamic<Container, S>
impl<Container, S> IntoIterator for Dynamic<Container, S>
Auto Trait Implementations§
impl<Container, S> Freeze for Dynamic<Container, S>where
S: Freeze,
impl<Container, S> RefUnwindSafe for Dynamic<Container, S>where
S: RefUnwindSafe,
Container: RefUnwindSafe,
impl<Container, S> Send for Dynamic<Container, S>
impl<Container, S> Sync for Dynamic<Container, S>
impl<Container, S> Unpin for Dynamic<Container, S>
impl<Container, S> UnwindSafe for Dynamic<Container, S>where
S: UnwindSafe,
Container: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more