pub trait DrainContainer {
type Item<'a>
where Self: 'a;
type DrainIter<'a>: Iterator<Item = Self::Item<'a>>
where Self: 'a;
// Required method
fn drain(&mut self) -> Self::DrainIter<'_>;
}
Expand description
A container that can drain itself.
Draining the container presents items in an implementation-specific order.
The container is in an undefined state after calling [drain
]. Dropping
the iterator also leaves the container in an undefined state.
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.