Struct anchors::singlethread::Engine[][src]

pub struct Engine { /* fields omitted */ }

The main execution engine of Singlethread.

Implementations

impl Engine[src]

pub fn new() -> Self[src]

Creates a new Engine with maximum height 256.

pub fn new_with_max_height(max_height: usize) -> Self[src]

Creates a new Engine with a custom maximum height.

pub fn mark_observed<O: 'static>(&mut self, anchor: &Anchor<O>)[src]

Marks an Anchor as observed. All observed nodes will always be brought up-to-date when any Anchor in the graph is retrieved. If you get an output value fairly often, it’s best to mark it as Observed so that Anchors can calculate its dependencies faster.

pub fn mark_unobserved<O: 'static>(&mut self, anchor: &Anchor<O>)[src]

Marks an Anchor as unobserved. If the anchor has parents that are necessary because anchor was previously observed, those parents will be unmarked as necessary.

pub fn get<'out, O: Clone + 'static>(&mut self, anchor: &Anchor<O>) -> O[src]

Retrieves the value of an Anchor, recalculating dependencies as necessary to get the latest value.

pub fn stabilize(&mut self)[src]

Ensure any Observed nodes are up-to-date, recalculating dependencies as necessary. You should rarely need to call this yourself; Engine::get calls it automatically.

pub fn debug_state(&self) -> String[src]

Returns a debug string containing the current state of the recomputation graph.

pub fn check_observed<T>(&self, anchor: &Anchor<T>) -> ObservedState[src]

pub fn check_observed_raw<'a>(node: NodeGuard<'a>) -> ObservedState[src]

Returns whether an Anchor is Observed, Necessary, or Unnecessary.

Trait Implementations

impl Engine for Engine[src]

type AnchorHandle = AnchorHandle

type DirtyHandle = DirtyHandle

Auto Trait Implementations

impl !RefUnwindSafe for Engine

impl !Send for Engine

impl !Sync for Engine

impl Unpin for Engine

impl !UnwindSafe for Engine

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.