Trait pop_trait::Pop
[−]
[src]
pub trait Pop<T>: LenZero { fn pop(&mut self) -> Option<T>; }
A mutable collection from which items can be removed from an arbitrary location in the collection.
Popping an item cannot increase the length of a collection if Some
value is returned, and
must not change the length if None
is returned. Additionally, the pop must take amortized O(1)
time and space to complete.
Returning None
from the collection does not necessarily mean that no value was popped, just
that the desired type could not be popped off. One should inspect the Len
of the type to check
if the container is truly empty.