[−][src]Struct dynamization::Dynamic
A dynamic version of Container
.
Implementations
impl<Container: Static, S: Strategy> Dynamic<Container, S>
[src]
pub fn new() -> Self
[src]
A new container with a default initial unit count.
pub fn with_unit_count(unit_count: usize) -> Self
[src]
A new container with a specified initial unit count.
pub fn add_unit(&mut self, container: Container)
[src]
Adds a new unit (partial container).
pub fn len(&self) -> usize
[src]
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.
pub fn is_empty(&self) -> bool
[src]
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.
pub fn units(&self) -> Units<'_, Container>ⓘ
[src]
Iterator over all the partial containers. Shared-reference version.
pub fn units_mut(&mut self) -> UnitsMut<'_, Container>ⓘ
[src]
Iterator over all the partial containers. Unique-reference version.
pub fn try_collect(self) -> Option<Container>
[src]
Collects all the partial containers into a single one.
Returns None
if there are no units.
pub fn clear(&mut self)
[src]
Clears all the partial containers.
impl<Container: Static + Singleton, S: Strategy> Dynamic<Container, S>
[src]
pub fn insert(&mut self, item: Container::Item)
[src]
Inserts a single item.
Requires Singleton
to be implemented for the container type.
Trait Implementations
impl<Container: Clone, S: Clone> Clone for Dynamic<Container, S>
[src]
pub fn clone(&self) -> Dynamic<Container, S>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Container: Debug, S: Debug> Debug for Dynamic<Container, S>
[src]
impl<Container, S> IntoIterator for Dynamic<Container, S>
[src]
Auto Trait Implementations
impl<Container, S> Send for Dynamic<Container, S> where
Container: Send,
S: Send,
Container: Send,
S: Send,
impl<Container, S> Sync for Dynamic<Container, S> where
Container: Sync,
S: Sync,
Container: Sync,
S: Sync,
impl<Container, S> Unpin for Dynamic<Container, S> where
Container: Unpin,
S: Unpin,
Container: Unpin,
S: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,