Trait try_push::TryPush[][src]

pub trait TryPush<T> {
    fn try_push(&mut self, elem: T) -> Element<T>;
fn try_push_front(&mut self, elem: T) -> Element<T>; }

Required methods

fn try_push(&mut self, elem: T) -> Element<T>[src]

Attempts to push an element to the collection. If that action would re-allocate or require shifting elements then the elem is returned in Element::NotAdded(). Otherwise, the return value is Element::Added.

fn try_push_front(&mut self, elem: T) -> Element<T>[src]

Attempts to push an element front to the collection. If that action would re-allocate or require shifting elements then the elem is returned in Element::NotAdded(). Otherwise, the return value is Element::Added.

Loading content...

Implementations on Foreign Types

impl<T> TryPush<T> for Vec<T>[src]

impl<T> TryPush<T> for VecDeque<T>[src]

Loading content...

Implementors

Loading content...