pub struct CreationContext<'a, I = ()> { /* private fields */ }Implementations§
Source§impl<'a> CreationContext<'a>
impl<'a> CreationContext<'a>
Source§impl<'a, I> CreationContext<'a, I>
impl<'a, I> CreationContext<'a, I>
pub fn new_() -> Self
pub fn new_trackable_input<D: Eq + Hash + Clone + 'a>( &mut self, ) -> (Input<'a, D>, InputRelation<D>)
pub fn begin(self) -> ExecutionContext<'a, I>
pub fn tracker(&self) -> ContextTracker
Source§impl<'a, I> CreationContext<'a, I>
impl<'a, I> CreationContext<'a, I>
Sourcepub fn feed<D>(
&mut self,
rel: Relation<impl Op<D = D> + 'a>,
input: Input<'a, D>,
)
pub fn feed<D>( &mut self, rel: Relation<impl Op<D = D> + 'a>, input: Input<'a, D>, )
Connects a Relation to an Input such that whenever ExecutionContext::commit is called,
any changes to the collection represented by the Relation argument are fed back into the
Input argument. This repeats until the collection stops changing.
Sourcepub fn feed_ordered<K: Ord + 'a, V: Eq + Hash + 'a>(
&mut self,
rel: Relation<impl Op<D = (K, V)> + 'a>,
input: Input<'a, V>,
)
pub fn feed_ordered<K: Ord + 'a, V: Eq + Hash + 'a>( &mut self, rel: Relation<impl Op<D = (K, V)> + 'a>, input: Input<'a, V>, )
Similar to feed except that the Relation argument
additionally has an ordering key. Rather than feeding all changes back into the Input, only
those with the minimum present ordering key are fed back in. If any later changes are cancelled
out as a result of this (if their count goes to zero), then they will not be fed in at all.
This can be handy in situations where using feed naively can cause an infinite loop.
pub fn interrupt<D, M: CountMap<D> + Observable + 'a>(
&mut self,
output: Output<D, impl Op<D = D> + 'a, M>,
f: impl Fn(&M) -> I + 'a,
)where
I: 'a,
Sourcepub fn feed_while<D: Clone + Eq + Hash + 'a>(
&mut self,
output: Output<D, impl Op<D = D> + 'a>,
input: Input<'a, D>,
)
pub fn feed_while<D: Clone + Eq + Hash + 'a>( &mut self, output: Output<D, impl Op<D = D> + 'a>, input: Input<'a, D>, )
Takes an Output as an argument rather than a Relation and rather
than propagating changes to it’s argument through will instead send the entire contents of that
Output on every visit. feed_while is intended to be used in circumstances where there exists
a negative feedback loop between the arguments and the caller wants to retain any visited values
rather than have them be immediately deleted.