Skip to main content

TryPush

Trait TryPush 

Source
pub trait TryPush<T>: Push<T> {
    type Error;

    // Required method
    fn try_push(&mut self, value: T) -> Result<Self::Output, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn try_push(&mut self, value: T) -> Result<Self::Output, Self::Error>

Push an value and return it’s index.

Implementations on Foreign Types§

Source§

impl TryPush<char> for String

Source§

type Error = ()

Source§

fn try_push( &mut self, value: char, ) -> Result<<String as Push<char>>::Output, <String as TryPush<char>>::Error>

Source§

impl<'b> TryPush<&'b OsStr> for OsString

Available on crate feature std only.
Source§

type Error = ()

Source§

fn try_push( &mut self, value: &'b OsStr, ) -> Result<<OsString as Push<&'b OsStr>>::Output, <OsString as TryPush<&'b OsStr>>::Error>

Source§

impl<T> TryPush<T> for LinkedList<T>

Source§

type Error = ()

Source§

fn try_push( &mut self, value: T, ) -> Result<<LinkedList<T> as Push<T>>::Output, <LinkedList<T> as TryPush<T>>::Error>

Source§

impl<T> TryPush<T> for Vec<T>

Source§

type Error = ()

Source§

fn try_push( &mut self, value: T, ) -> Result<<Vec<T> as Push<T>>::Output, <Vec<T> as TryPush<T>>::Error>

Source§

impl<T, const CAP: usize> TryPush<T> for ArrayVec<T, CAP>

Source§

type Error = CapacityFullError<T>

Source§

fn try_push( &mut self, value: T, ) -> Result<<ArrayVec<T, CAP> as Push<T>>::Output, <ArrayVec<T, CAP> as TryPush<T>>::Error>

Implementors§

Source§

impl<P> TryPush<P> for PathBuf
where P: AsRef<Path>,

Available on crate feature std only.
Source§

impl<T> TryPush<T> for BinaryHeap<T>
where T: Ord,

Source§

impl<T> TryPush<T> for VecDeque<T>

Source§

impl<T, Gen, C> TryPush<T> for GenSeq<T, Gen, C>
where C: AsRef<[Entry<T, Gen>]> + AsMut<[Entry<T, Gen>]> + TryPush<Entry<T, Gen>>, Gen: IGeneration,

Source§

type Error = <C as TryPush<Entry<T, Gen>>>::Error