pub enum Relationship {
Trigger,
Observe,
}Expand description
Defines how wsnl relate to each other in the computation graph.
Relationships determine when and how changes propagate between wsnl. This is fundamental to the incremental computation model - wsnl only recompute when their dependencies change.
Variants§
Trigger
The parent node will schedule this node when it mutates.
Use Trigger when this node should react to changes
in the parent node. This creates an active dependency.
Observe
This node can read from the parent but won’t be automatically scheduled.
Use Observe when this node needs access to the parent’s data but
doesn’t need to react to changes in the parent. The node can check if the
parent has mutated using ExecutionContext::has_mutated(). This is most
commonly used when a node reacts to a specific trigger relationship to
one parent but just needs the data of another.
Implementations§
Source§impl Relationship
impl Relationship
Sourcepub fn is_trigger(&self) -> bool
pub fn is_trigger(&self) -> bool
Returns true if this is a Relationship::Trigger, otherwise false
Sourcepub fn is_observe(&self) -> bool
pub fn is_observe(&self) -> bool
Returns true if this is a Relationship::Observe, otherwise false
Trait Implementations§
Source§impl Clone for Relationship
impl Clone for Relationship
Source§fn clone(&self) -> Relationship
fn clone(&self) -> Relationship
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Relationship
impl Debug for Relationship
Source§impl Hash for Relationship
impl Hash for Relationship
Source§impl PartialEq for Relationship
impl PartialEq for Relationship
impl Copy for Relationship
impl Eq for Relationship
impl StructuralPartialEq for Relationship
Auto Trait Implementations§
impl Freeze for Relationship
impl RefUnwindSafe for Relationship
impl Send for Relationship
impl Sync for Relationship
impl Unpin for Relationship
impl UnwindSafe for Relationship
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> 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.