Trait CanPush

Source
pub trait CanPush<T>: Clear {
    type PushedOut;
}
Expand description

A trait for collections which can implement some form of Push trait.

Some containers have limitations on which elements can be stored at once; these collections will “push out” a value after the push happens. A finite-size buffer may push out the oldest value, or a map may push out a value at the same key.

Required Associated Types§

Source

type PushedOut

Type of value that would get pushed out, if any.

Implementations on Foreign Types§

Source§

impl CanPush<char> for String

Source§

impl CanPush<char> for Vec<u8>

Source§

impl CanPush<char> for Vec<u16>

Source§

impl CanPush<char> for Vec<u32>

Source§

impl<'a> CanPush<&'a str> for String

Source§

impl<'a> CanPush<&'a str> for OsString

Source§

impl<'a> CanPush<&'a OsStr> for OsString

Source§

impl<'a, T: 'a + Clone> CanPush<&'a [T]> for Vec<T>

Source§

impl<K: Ord, V> CanPush<(K, V)> for BTreeMap<K, V>

Source§

impl<K: Hash + Eq, V> CanPush<(K, V)> for HashMap<K, V>

Source§

impl<T> CanPush<T> for LinkedList<T>

Source§

impl<T> CanPush<T> for VecDeque<T>

Source§

impl<T> CanPush<T> for Vec<T>

Source§

impl<T: Ord> CanPush<T> for BinaryHeap<T>

Source§

impl<T: Ord> CanPush<T> for BTreeSet<T>

Source§

impl<T: Hash + Eq> CanPush<T> for HashSet<T>

Implementors§

Source§

impl<T: Append> CanPush<T> for T