CreationContext

Struct CreationContext 

Source
pub struct CreationContext<'a, I = ()> { /* private fields */ }

Implementations§

Source§

impl<'a> CreationContext<'a>

Source

pub fn new() -> Self

Source§

impl<'a, I> CreationContext<'a, I>

Source

pub fn new_() -> Self

Source

pub fn new_trackable_input<D: Eq + Hash + Clone + 'a>( &mut self, ) -> (Input<'a, D>, InputRelation<D>)

Source

pub fn begin(self) -> ExecutionContext<'a, I>

Source

pub fn tracker(&self) -> ContextTracker

Source§

impl<'a, I> CreationContext<'a, I>

Source

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.

Source

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.

Source

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,

Source

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.

Methods from Deref<Target = CreationContext<'a>>§

Source

pub fn new_input<D: 'a>(&mut self) -> (Input<'a, D>, InputRelation<D>)

Source

pub fn new_input_<T: 'a>(&mut self) -> (Input_<'a, T>, Relation<InputOp<T>>)

Source

pub fn tracker(&self) -> &ContextTracker

Trait Implementations§

Source§

impl<I> Default for CreationContext<'_, I>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a, I> Deref for CreationContext<'a, I>

Source§

type Target = CreationContext<'a>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a, I> DerefMut for CreationContext<'a, I>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, I> Freeze for CreationContext<'a, I>

§

impl<'a, I = ()> !RefUnwindSafe for CreationContext<'a, I>

§

impl<'a, I = ()> !Send for CreationContext<'a, I>

§

impl<'a, I = ()> !Sync for CreationContext<'a, I>

§

impl<'a, I> Unpin for CreationContext<'a, I>

§

impl<'a, I = ()> !UnwindSafe for CreationContext<'a, I>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Is for T

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.