pub struct BoundedSeen<T> { /* private fields */ }Expand description
A set with a bounded capacity that evicts the oldest entry on overflow.
Insertion (insert) returns true when the item is new and was added,
false when it was already present. When len() == cap, the least
recently inserted item is removed before the new item is added.
Implementations§
Source§impl<T> BoundedSeen<T>
impl<T> BoundedSeen<T>
Sourcepub fn new(cap: usize) -> BoundedSeen<T>
pub fn new(cap: usize) -> BoundedSeen<T>
Creates a new set with the given capacity limit.
N=10000 is the recommended default per epoch (GTP §5, GSP §5).
Trait Implementations§
Source§impl<T> Clone for BoundedSeen<T>where
T: Clone,
impl<T> Clone for BoundedSeen<T>where
T: Clone,
Source§fn clone(&self) -> BoundedSeen<T>
fn clone(&self) -> BoundedSeen<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for BoundedSeen<T>
impl<T> RefUnwindSafe for BoundedSeen<T>where
T: RefUnwindSafe,
impl<T> Send for BoundedSeen<T>where
T: Send,
impl<T> Sync for BoundedSeen<T>where
T: Sync,
impl<T> Unpin for BoundedSeen<T>where
T: Unpin,
impl<T> UnsafeUnpin for BoundedSeen<T>
impl<T> UnwindSafe for BoundedSeen<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more