Struct priority_container::PrioContainer
source · [−]pub struct PrioContainer<T> { /* private fields */ }
Expand description
Priority container storing max capacity
amount of items. Can be used to find
n
smallest items within an iterator or a set of items that implement Ord
Implementations
sourceimpl<T: Ord> PrioContainer<T>
impl<T: Ord> PrioContainer<T>
sourcepub fn new_allocated(capacity: usize) -> Self
pub fn new_allocated(capacity: usize) -> Self
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the amount of items in the container. This value
is always smaller or equal to capacity
sourcepub fn total_pushed(&self) -> usize
pub fn total_pushed(&self) -> usize
Returns the total amount of items pushed into the prio container
sourcepub fn into_sorted_vec(self) -> Vec<T>
pub fn into_sorted_vec(self) -> Vec<T>
Return a sorted vec of the prio container
Trait Implementations
sourceimpl<T: Ord> Extend<T> for PrioContainer<T>
impl<T: Ord> Extend<T> for PrioContainer<T>
sourcefn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬 This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬 This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<T: Ord> IntoIterator for PrioContainer<T>
impl<T: Ord> IntoIterator for PrioContainer<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for PrioContainer<T> where
T: RefUnwindSafe,
impl<T> Send for PrioContainer<T> where
T: Send,
impl<T> Sync for PrioContainer<T> where
T: Sync,
impl<T> Unpin for PrioContainer<T> where
T: Unpin,
impl<T> UnwindSafe for PrioContainer<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more