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>(&mut self, item: T)
       where T: PushInto<Self> { ... }
}
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>(&mut self, item: T)
where T: PushInto<Self>,

Push item into self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

source§

fn capacity(&self) -> usize

source§

fn preferred_capacity() -> usize

source§

fn reserve(&mut self, additional: usize)

Implementors§

source§

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

source§

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