pub trait Container {
type Key;
type Value;
type Entry<'a>: ContainerEntry<'a, Key = Self::Key, Value = Self::Value>
where Self: 'a,
Self::Key: 'a,
Self::Value: 'a;
type Iter<'a>: Iterator<Item = (&'a Self::Key, &'a Self::Value)>
where Self: 'a,
Self::Key: 'a,
Self::Value: 'a;
type Drain<'a>: Iterator<Item = (Self::Key, Self::Value)>
where Self: 'a,
Self::Key: 'a,
Self::Value: 'a;
// Required methods
fn get(&self, key: &Self::Key) -> Option<&Self::Value>;
fn get_mut(&mut self, key: &Self::Key) -> Option<&mut Self::Value>;
fn insert(
&mut self,
key: Self::Key,
value: Self::Value,
) -> Option<Self::Value>;
fn remove(&mut self, key: &Self::Key) -> Option<Self::Value>;
fn entry(&mut self, key: Self::Key) -> Self::Entry<'_>;
fn iter(&self) -> Self::Iter<'_>;
fn drain(&mut self) -> Self::Drain<'_>;
}
Required Associated Types§
type Key
type Value
type Entry<'a>: ContainerEntry<'a, Key = Self::Key, Value = Self::Value> where Self: 'a, Self::Key: 'a, Self::Value: 'a
type Iter<'a>: Iterator<Item = (&'a Self::Key, &'a Self::Value)> where Self: 'a, Self::Key: 'a, Self::Value: 'a
type Drain<'a>: Iterator<Item = (Self::Key, Self::Value)> where Self: 'a, Self::Key: 'a, Self::Value: 'a
Required Methods§
fn get(&self, key: &Self::Key) -> Option<&Self::Value>
fn get_mut(&mut self, key: &Self::Key) -> Option<&mut Self::Value>
fn insert(&mut self, key: Self::Key, value: Self::Value) -> Option<Self::Value>
fn remove(&mut self, key: &Self::Key) -> Option<Self::Value>
fn entry(&mut self, key: Self::Key) -> Self::Entry<'_>
fn iter(&self) -> Self::Iter<'_>
fn drain(&mut self) -> Self::Drain<'_>
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.