Trait TryPush

Source
pub trait TryPush<T> {
    // Required method
    fn try_push(&mut self, item: T) -> Result<(), T>;
}
Expand description

Try to push an element onto a collection

Required Methods§

Source

fn try_push(&mut self, item: T) -> Result<(), T>

Try to push an element onto a collection.

Returns the original element if it’s full.

Implementors§