pub trait ContainerQueue<C: DrainContainer> {
// Required methods
fn next_or_alloc(&mut self) -> Result<C::Item<'_>, C>;
fn is_empty(&self) -> bool;
fn cmp_heads(&self, other: &Self) -> Ordering;
fn from(container: C) -> Self;
}Expand description
An abstraction for a container that can be iterated over, and conclude by returning itself.
Required Methods§
Sourcefn next_or_alloc(&mut self) -> Result<C::Item<'_>, C>
fn next_or_alloc(&mut self) -> Result<C::Item<'_>, C>
Returns either the next item in the container, or the container itself.
Sourcefn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Indicates whether next_or_alloc will return Ok, and whether peek will return Some.
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.