pub struct DiscordAssignment { /* private fields */ }Expand description
Discord assignment D_A : C -> P(K).
In v0.83 this is a materialized map from context id to discord set. Production builds will compute this lazily from a registry of detectors against an Atlas; that wiring lands when the Atlas presheaf does (target v0.8).
Implementations§
Source§impl DiscordAssignment
impl DiscordAssignment
Sourcepub fn build_from_detectors<D: Detector>(
detectors: &[D],
contexts: &[ContextId],
) -> Self
pub fn build_from_detectors<D: Detector>( detectors: &[D], contexts: &[ContextId], ) -> Self
Build from a registry of detectors evaluated over a finite set of contexts.
Each detector is invoked once per context. If fires
returns true, the corresponding kind is added to that
context’s discord set.
Sourcepub fn set(&mut self, context: impl Into<ContextId>, kinds: DiscordSet)
pub fn set(&mut self, context: impl Into<ContextId>, kinds: DiscordSet)
Set the discord set at a single context.
Sourcepub fn get(&self, context: &str) -> DiscordSet
pub fn get(&self, context: &str) -> DiscordSet
Get the discord set at a context, or empty if absent.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&ContextId, &DiscordSet)>
pub fn iter(&self) -> impl Iterator<Item = (&ContextId, &DiscordSet)>
Iterate (context, discord_set) pairs.
Sourcepub fn frontier_support(&self) -> FrontierSupport
pub fn frontier_support(&self) -> FrontierSupport
Frontier support: the set of contexts where any discord kind fires.
Sourcepub fn context_count(&self) -> usize
pub fn context_count(&self) -> usize
Number of contexts in this assignment.
Trait Implementations§
Source§impl Clone for DiscordAssignment
impl Clone for DiscordAssignment
Source§fn clone(&self) -> DiscordAssignment
fn clone(&self) -> DiscordAssignment
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 DiscordAssignment
impl Debug for DiscordAssignment
Source§impl Default for DiscordAssignment
impl Default for DiscordAssignment
Source§fn default() -> DiscordAssignment
fn default() -> DiscordAssignment
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DiscordAssignment
impl<'de> Deserialize<'de> for DiscordAssignment
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 PartialEq for DiscordAssignment
impl PartialEq for DiscordAssignment
Source§fn eq(&self, other: &DiscordAssignment) -> bool
fn eq(&self, other: &DiscordAssignment) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DiscordAssignment
impl Serialize for DiscordAssignment
impl Eq for DiscordAssignment
impl StructuralPartialEq for DiscordAssignment
Auto Trait Implementations§
impl Freeze for DiscordAssignment
impl RefUnwindSafe for DiscordAssignment
impl Send for DiscordAssignment
impl Sync for DiscordAssignment
impl Unpin for DiscordAssignment
impl UnsafeUnpin for DiscordAssignment
impl UnwindSafe for DiscordAssignment
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> 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.