Trait timely_container::PushContainer

source ·
pub trait PushContainer: Container {
    // Required methods
    fn capacity(&self) -> usize;
    fn preferred_capacity() -> usize;
    fn reserve(&mut self, additional: usize);

    // Provided method
    fn push<T: PushInto<Self>>(&mut self, item: T) { ... }
}
Expand description

A type that has the necessary infrastructure to push elements, without specifying how pushing itself works. For this, pushable types should implement PushInto.

Required Methods§

source

fn capacity(&self) -> usize

Return the capacity of the container.

source

fn preferred_capacity() -> usize

Return the preferred capacity of the container.

source

fn reserve(&mut self, additional: usize)

Reserve space for additional elements, possibly increasing the capacity of the container.

Provided Methods§

source

fn push<T: PushInto<Self>>(&mut self, item: T)

Push item into self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T: Clone + 'static> PushContainer for Vec<T>

source§

fn capacity(&self) -> usize

source§

fn preferred_capacity() -> usize

source§

fn reserve(&mut self, additional: usize)

Implementors§

source§

impl<R: Region + Clone + 'static> PushContainer for FlatStack<R>

source§

impl<T: Columnation + 'static> PushContainer for TimelyStack<T>