pub struct EffectKind {
pub name: String,
pub arg: Option<EffectArg>,
}Expand description
Effect set with an optional row variable.
concrete is the closed lower bound — effect kinds the function
definitely uses. var is an open extension point used for effect
polymorphism on stdlib higher-order functions: list.map[T, U, E]
declares its callback as (T) -> [E] U where E is var: Some(id).
At call sites the variable unifies with whatever effect set the
actual closure carries, then propagates to the result.
All call sites that compare or merge concrete-only sets continue to
work via the helper methods, which delegate to concrete.
A single effect entry. Bare [net] is the wildcard form
(arg = None); parameterized [net("wttr.in")] carries an arg
(#207). Sort order matches the String ordering of (name, arg)
so BTreeSet<EffectKind> keeps a canonical iteration order.
Fields§
§name: String§arg: Option<EffectArg>Implementations§
Source§impl EffectKind
impl EffectKind
Sourcepub fn bare(name: impl Into<String>) -> Self
pub fn bare(name: impl Into<String>) -> Self
Bare [name] — the wildcard form. Matches anything with the
same name regardless of arg.
Sourcepub fn with_str(name: impl Into<String>, arg: impl Into<String>) -> Self
pub fn with_str(name: impl Into<String>, arg: impl Into<String>) -> Self
Parameterized [name("value")].
Sourcepub fn subsumes(&self, other: &EffectKind) -> bool
pub fn subsumes(&self, other: &EffectKind) -> bool
Returns true iff self is at least as permissive as other —
i.e., a context declaring self can satisfy a callee
requiring other. Bare absorbs specific ([mcp] accepts
[mcp(ocpp)]); specifics match only themselves ([mcp(ocpp)]
does not accept [mcp(other)]); names must match either way.
Trait Implementations§
Source§impl Clone for EffectKind
impl Clone for EffectKind
Source§fn clone(&self) -> EffectKind
fn clone(&self) -> EffectKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EffectKind
impl Debug for EffectKind
impl Eq for EffectKind
Source§impl Ord for EffectKind
impl Ord for EffectKind
Source§fn cmp(&self, other: &EffectKind) -> Ordering
fn cmp(&self, other: &EffectKind) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for EffectKind
impl PartialEq for EffectKind
Source§fn eq(&self, other: &EffectKind) -> bool
fn eq(&self, other: &EffectKind) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for EffectKind
impl PartialOrd for EffectKind
impl StructuralPartialEq for EffectKind
Auto Trait Implementations§
impl Freeze for EffectKind
impl RefUnwindSafe for EffectKind
impl Send for EffectKind
impl Sync for EffectKind
impl Unpin for EffectKind
impl UnsafeUnpin for EffectKind
impl UnwindSafe for EffectKind
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
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
key and return true if they are equal.