pub trait TryIndex<Idx: ?Sized> {
type Output;
// Required methods
fn try_index(&self, index: &Idx) -> Option<&Self::Output>;
fn try_remove(&mut self, index: &Idx) -> Option<Self::Output>;
}Expand description
A collection that can look an element up by key without panicking when it is not there.
This is std::ops::Index with the failure made visible, plus the owning
counterpart that the index operator has no equivalent of.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".