pub trait TryPush {
type Item;
type Error;
type ItemView<'a>
where Self: 'a;
// Required method
fn try_push<'a>(
&'a mut self,
item: Self::Item,
) -> Result<Self::ItemView<'a>, Self::Error>;
}Expand description
Abstracts something you can try push item into &mut self
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<Item> TryPush for LinkedList<Item>
Available on crate feature alloc only.
impl<Item> TryPush for LinkedList<Item>
Available on crate feature
alloc only.Source§impl<Item, const N: usize> TryPush for SmallVec<[Item; N]>
Available on crate feature smallvec only.
impl<Item, const N: usize> TryPush for SmallVec<[Item; N]>
Available on crate feature
smallvec only.Source§impl<Item: Eq + Hash, Seed: BuildHasher> TryPush for HashSet<Item, Seed>
Available on crate feature hashmap only.
impl<Item: Eq + Hash, Seed: BuildHasher> TryPush for HashSet<Item, Seed>
Available on crate feature
hashmap only.Source§impl<Item: Ord> TryPush for BinaryHeap<Item>
Available on crate feature alloc only.
impl<Item: Ord> TryPush for BinaryHeap<Item>
Available on crate feature
alloc only.Source§impl<Key: Eq + Hash, Value, Seed: BuildHasher> TryPush for HashMap<Key, Value, Seed>
Available on crate feature hashmap only.
impl<Key: Eq + Hash, Value, Seed: BuildHasher> TryPush for HashMap<Key, Value, Seed>
Available on crate feature
hashmap only.