pub struct EventIdSet<E>(/* private fields */)
where
E: Borrow<EventId>;Available on crate feature
state-res only.Expand description
A set of event IDs.
Implementations§
Source§impl<E> EventIdSet<E>
impl<E> EventIdSet<E>
Sourcepub fn new() -> EventIdSet<E>
pub fn new() -> EventIdSet<E>
Create an empty EventIdSet.
Sourcepub fn with_capacity(capacity: usize) -> EventIdSet<E>
pub fn with_capacity(capacity: usize) -> EventIdSet<E>
Create an empty EventIdSet with the given capacity.
Sourcepub fn iter(&self) -> EventIdSetIter<'_, E> ⓘ
pub fn iter(&self) -> EventIdSetIter<'_, E> ⓘ
Gets an iterator over the elements of the set.
Source§impl<E> EventIdSet<E>
impl<E> EventIdSet<E>
Sourcepub fn contains(&self, event_id: &EventId) -> bool
pub fn contains(&self, event_id: &EventId) -> bool
Returns true if the set contains the specified event ID.
Sourcepub fn get(&self, event_id: &EventId) -> Option<&E>
pub fn get(&self, event_id: &EventId) -> Option<&E>
Returns a reference to the event ID in the set, if any, that is equal to the given one.
Sourcepub fn insert(&mut self, event_id: E) -> bool
pub fn insert(&mut self, event_id: E) -> bool
Adds an event ID to the set.
Returns whether the ID was newly inserted.
Sourcepub fn remove(&mut self, event_id: &EventId) -> bool
pub fn remove(&mut self, event_id: &EventId) -> bool
Removes an event ID from the set.
Returns whether the ID was present in the set.
Sourcepub fn take(&mut self, event_id: &EventId) -> Option<E>
pub fn take(&mut self, event_id: &EventId) -> Option<E>
Removes and returns the event ID in the set, if any, that is equal to the given one.
Sourcepub fn intersection<'a>(
&'a self,
other: &'a EventIdSet<E>,
) -> EventIdSetIntersection<'a, E> ⓘ
pub fn intersection<'a>( &'a self, other: &'a EventIdSet<E>, ) -> EventIdSetIntersection<'a, E> ⓘ
Visits the values representing the intersection, i.e., the values that are both in self and other.
Trait Implementations§
Source§impl<E> Clone for EventIdSet<E>
impl<E> Clone for EventIdSet<E>
Source§fn clone(&self) -> EventIdSet<E>
fn clone(&self) -> EventIdSet<E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<E> Debug for EventIdSet<E>
impl<E> Debug for EventIdSet<E>
Source§impl<E> Default for EventIdSet<E>
impl<E> Default for EventIdSet<E>
Source§fn default() -> EventIdSet<E>
fn default() -> EventIdSet<E>
Returns the “default value” for a type. Read more
Source§impl<E> Extend<E> for EventIdSet<E>
impl<E> Extend<E> for EventIdSet<E>
Source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = E>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = E>,
Extends a collection with the contents of an iterator. Read more
Source§fn 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.
Source§fn 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
Source§impl<E, const N: usize> From<[E; N]> for EventIdSet<E>
impl<E, const N: usize> From<[E; N]> for EventIdSet<E>
Source§fn from(value: [E; N]) -> EventIdSet<E>
fn from(value: [E; N]) -> EventIdSet<E>
Converts to this type from the input type.
Source§impl<E> FromIterator<E> for EventIdSet<E>
impl<E> FromIterator<E> for EventIdSet<E>
Source§fn from_iter<T>(iter: T) -> EventIdSet<E>where
T: IntoIterator<Item = E>,
fn from_iter<T>(iter: T) -> EventIdSet<E>where
T: IntoIterator<Item = E>,
Creates a value from an iterator. Read more
Source§impl<'a, E> IntoIterator for &'a EventIdSet<E>
impl<'a, E> IntoIterator for &'a EventIdSet<E>
Source§type IntoIter = EventIdSetIter<'a, E>
type IntoIter = EventIdSetIter<'a, E>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <&'a EventIdSet<E> as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a EventIdSet<E> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Source§impl<E> IntoIterator for EventIdSet<E>
impl<E> IntoIterator for EventIdSet<E>
Source§type IntoIter = EventIdSetIntoIter<E>
type IntoIter = EventIdSetIntoIter<E>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <EventIdSet<E> as IntoIterator>::IntoIter
fn into_iter(self) -> <EventIdSet<E> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Auto Trait Implementations§
impl<E> Freeze for EventIdSet<E>
impl<E> RefUnwindSafe for EventIdSet<E>where
E: RefUnwindSafe,
impl<E> Send for EventIdSet<E>where
E: Send,
impl<E> Sync for EventIdSet<E>where
E: Sync,
impl<E> Unpin for EventIdSet<E>where
E: Unpin,
impl<E> UnsafeUnpin for EventIdSet<E>
impl<E> UnwindSafe for EventIdSet<E>where
E: 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> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read more