timely_container

Trait SizableContainer

Source
pub trait SizableContainer: Container {
    // Required methods
    fn at_capacity(&self) -> bool;
    fn ensure_capacity(&mut self, stash: &mut Option<Self>);
}
Expand description

A container that can be sized and reveals its capacity.

Required Methods§

Source

fn at_capacity(&self) -> bool

Indicates that the container is “full” and should be shipped.

Source

fn ensure_capacity(&mut self, stash: &mut Option<Self>)

Restores self to its desired capacity, if it has one.

The stash argument is available, and may have the intended capacity. However, it may be non-empty, and may be of the wrong capacity. The method should guard against these cases.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> SizableContainer for Vec<T>

Source§

fn at_capacity(&self) -> bool

Source§

fn ensure_capacity(&mut self, stash: &mut Option<Self>)

Implementors§