pub struct SideEffects { /* private fields */ }Expand description
An unordered set of SideEffect tags attached to a tool.
Backed by HashSet; insertion order is not preserved. Use
SideEffects::iter to read out the contents.
Implementations§
Source§impl SideEffects
impl SideEffects
Sourcepub fn insert(&mut self, effect: SideEffect) -> bool
pub fn insert(&mut self, effect: SideEffect) -> bool
Insert a tag. Returns true if the tag was newly added.
Sourcepub fn remove(&mut self, effect: SideEffect) -> bool
pub fn remove(&mut self, effect: SideEffect) -> bool
Remove a tag. Returns true if the tag was present.
Sourcepub fn contains(&self, effect: SideEffect) -> bool
pub fn contains(&self, effect: SideEffect) -> bool
Returns true iff the set contains effect.
Sourcepub fn iter(&self) -> impl Iterator<Item = &SideEffect>
pub fn iter(&self) -> impl Iterator<Item = &SideEffect>
Iterate over the tags in arbitrary order.
Trait Implementations§
Source§impl Clone for SideEffects
impl Clone for SideEffects
Source§fn clone(&self) -> SideEffects
fn clone(&self) -> SideEffects
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 moreSource§impl Debug for SideEffects
impl Debug for SideEffects
Source§impl Default for SideEffects
impl Default for SideEffects
Source§fn default() -> SideEffects
fn default() -> SideEffects
Returns the “default value” for a type. Read more
Source§impl FromIterator<SideEffect> for SideEffects
impl FromIterator<SideEffect> for SideEffects
Source§fn from_iter<I: IntoIterator<Item = SideEffect>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = SideEffect>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl PartialEq for SideEffects
impl PartialEq for SideEffects
Source§fn eq(&self, other: &SideEffects) -> bool
fn eq(&self, other: &SideEffects) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for SideEffects
impl StructuralPartialEq for SideEffects
Auto Trait Implementations§
impl Freeze for SideEffects
impl RefUnwindSafe for SideEffects
impl Send for SideEffects
impl Sync for SideEffects
impl Unpin for SideEffects
impl UnsafeUnpin for SideEffects
impl UnwindSafe for SideEffects
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