pub trait Collection{
type Item;
type RefIter<'a>: ExactSizeIterator<Item = &'a Self::Item>
where Self::Item: 'a,
Self: 'a;
type ReverseIter<'a>: Iterator<Item = &'a Self::Item>
where Self::Item: 'a,
Self: 'a;
// Required methods
fn len(&self) -> usize;
fn iter(&self) -> Self::RefIter<'_>;
fn reversed(&self) -> Self::ReverseIter<'_>;
fn insert(&mut self, item: Self::Item) -> Result<(), DecodeErrorKind>;
}Expand description
Trait for containers that store multiple items such as Vec, BTreeSet, and HashSet
Required Associated Types§
type Item
type RefIter<'a>: ExactSizeIterator<Item = &'a Self::Item> where Self::Item: 'a, Self: 'a
type ReverseIter<'a>: Iterator<Item = &'a Self::Item> where Self::Item: 'a, Self: 'a
Required Methods§
fn len(&self) -> usize
fn iter(&self) -> Self::RefIter<'_>
fn reversed(&self) -> Self::ReverseIter<'_>
fn insert(&mut self, item: Self::Item) -> Result<(), DecodeErrorKind>
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.