pub struct DiscordSet { /* private fields */ }Expand description
A subset of DiscordKind. An element of the lattice L = P(K).
Empty means agreement / no detected discord at this context.
Implementations§
Source§impl DiscordSet
impl DiscordSet
Sourcepub fn singleton(kind: DiscordKind) -> Self
pub fn singleton(kind: DiscordKind) -> Self
Single-kind discord set.
Sourcepub fn from_kinds(kinds: impl IntoIterator<Item = DiscordKind>) -> Self
pub fn from_kinds(kinds: impl IntoIterator<Item = DiscordKind>) -> Self
Build from any iterable of kinds.
Sourcepub fn contains(&self, kind: DiscordKind) -> bool
pub fn contains(&self, kind: DiscordKind) -> bool
Whether kind is in this set.
Sourcepub fn insert(&mut self, kind: DiscordKind) -> bool
pub fn insert(&mut self, kind: DiscordKind) -> bool
Insert a kind. Returns true if newly inserted.
Sourcepub fn iter(&self) -> impl Iterator<Item = DiscordKind> + '_
pub fn iter(&self) -> impl Iterator<Item = DiscordKind> + '_
Iterate kinds in canonical (sorted) order.
Trait Implementations§
Source§impl Clone for DiscordSet
impl Clone for DiscordSet
Source§fn clone(&self) -> DiscordSet
fn clone(&self) -> DiscordSet
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 DiscordSet
impl Debug for DiscordSet
Source§impl Default for DiscordSet
impl Default for DiscordSet
Source§fn default() -> DiscordSet
fn default() -> DiscordSet
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DiscordSet
impl<'de> Deserialize<'de> for DiscordSet
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DiscordSet
impl Display for DiscordSet
Source§impl Ord for DiscordSet
impl Ord for DiscordSet
Source§fn cmp(&self, other: &DiscordSet) -> Ordering
fn cmp(&self, other: &DiscordSet) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DiscordSet
impl PartialEq for DiscordSet
Source§fn eq(&self, other: &DiscordSet) -> bool
fn eq(&self, other: &DiscordSet) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for DiscordSet
impl PartialOrd for DiscordSet
Source§impl Serialize for DiscordSet
impl Serialize for DiscordSet
impl Eq for DiscordSet
impl StructuralPartialEq for DiscordSet
Auto Trait Implementations§
impl Freeze for DiscordSet
impl RefUnwindSafe for DiscordSet
impl Send for DiscordSet
impl Sync for DiscordSet
impl Unpin for DiscordSet
impl UnsafeUnpin for DiscordSet
impl UnwindSafe for DiscordSet
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.