Struct anchors::expert::Anchor[][src]

pub struct Anchor<O, E: Engine + ?Sized> { /* fields omitted */ }

The main struct of the Anchors library. Represents a single value on the recomputation graph.

This doesn’t contain the particular Anchor implementation directly, but instead contains an engine-specific AnchorHandle which allows the recalculation engine to identify which internal recomputation graph node this corresponds to. You should rarely create Anchors yourself; instead use one of the built-in functions like Var::new to create one, or create derivative Anchors with one of the AnchorExt methods.

Implementations

impl<E: Engine, K: Ord + Clone + PartialEq + 'static, V: Clone + PartialEq + 'static> Anchor<Dict<K, V>, E>[src]

pub fn filter<F: FnMut(&K, &V) -> bool + 'static>(
    &self,
    f: F
) -> Anchor<Dict<K, V>, E>
[src]

pub fn map<F: FnMut(&K, &V) -> T + 'static, T: Clone + PartialEq + 'static>(
    &self,
    f: F
) -> Anchor<Dict<K, T>, E>
[src]

pub fn filter_map<F: FnMut(&K, &V) -> Option<T> + 'static, T: Clone + PartialEq + 'static>(
    &self,
    f: F
) -> Anchor<Dict<K, T>, E>
[src]

pub fn unordered_fold<T: PartialEq + Clone + 'static, F: for<'a> FnMut(&mut T, DiffItem<'a, K, V>) -> bool + 'static>(
    &self,
    initial_state: T,
    f: F
) -> Anchor<T, E>
[src]

impl<O, E: Engine> Anchor<O, E>[src]

pub fn new(data: E::AnchorHandle) -> Self[src]

pub fn token(&self) -> <E::AnchorHandle as AnchorHandle>::Token[src]

Returns the immutable, copyable, hashable, comparable engine-specific ID for this Anchor.

Trait Implementations

impl<O1, E> AnchorExt<E> for &Anchor<O1, E> where
    O1: 'static,
    E: Engine
[src]

type Target = (Anchor<O1, E>,)

impl<O0, E> AnchorSplit<E> for Anchor<(O0,), E> where
    O0: Clone + PartialEq + 'static,
    E: Engine
[src]

type Target = (Anchor<O0, E>,)

impl<O0, O1, E> AnchorSplit<E> for Anchor<(O0, O1), E> where
    O0: Clone + PartialEq + 'static,
    O1: Clone + PartialEq + 'static,
    E: Engine
[src]

type Target = (Anchor<O0, E>, Anchor<O1, E>)

impl<O0, O1, O2, E> AnchorSplit<E> for Anchor<(O0, O1, O2), E> where
    O0: Clone + PartialEq + 'static,
    O1: Clone + PartialEq + 'static,
    O2: Clone + PartialEq + 'static,
    E: Engine
[src]

type Target = (Anchor<O0, E>, Anchor<O1, E>, Anchor<O2, E>)

impl<O0, O1, O2, O3, E> AnchorSplit<E> for Anchor<(O0, O1, O2, O3), E> where
    O0: Clone + PartialEq + 'static,
    O1: Clone + PartialEq + 'static,
    O2: Clone + PartialEq + 'static,
    O3: Clone + PartialEq + 'static,
    E: Engine
[src]

type Target = (Anchor<O0, E>, Anchor<O1, E>, Anchor<O2, E>, Anchor<O3, E>)

impl<O0, O1, O2, O3, O4, E> AnchorSplit<E> for Anchor<(O0, O1, O2, O3, O4), E> where
    O0: Clone + PartialEq + 'static,
    O1: Clone + PartialEq + 'static,
    O2: Clone + PartialEq + 'static,
    O3: Clone + PartialEq + 'static,
    O4: Clone + PartialEq + 'static,
    E: Engine
[src]

type Target = (Anchor<O0, E>, Anchor<O1, E>, Anchor<O2, E>, Anchor<O3, E>, Anchor<O4, E>)

impl<O0, O1, O2, O3, O4, O5, E> AnchorSplit<E> for Anchor<(O0, O1, O2, O3, O4, O5), E> where
    O0: Clone + PartialEq + 'static,
    O1: Clone + PartialEq + 'static,
    O2: Clone + PartialEq + 'static,
    O3: Clone + PartialEq + 'static,
    O4: Clone + PartialEq + 'static,
    O5: Clone + PartialEq + 'static,
    E: Engine
[src]

type Target = (Anchor<O0, E>, Anchor<O1, E>, Anchor<O2, E>, Anchor<O3, E>, Anchor<O4, E>, Anchor<O5, E>)

impl<O0, O1, O2, O3, O4, O5, O6, E> AnchorSplit<E> for Anchor<(O0, O1, O2, O3, O4, O5, O6), E> where
    O0: Clone + PartialEq + 'static,
    O1: Clone + PartialEq + 'static,
    O2: Clone + PartialEq + 'static,
    O3: Clone + PartialEq + 'static,
    O4: Clone + PartialEq + 'static,
    O5: Clone + PartialEq + 'static,
    O6: Clone + PartialEq + 'static,
    E: Engine
[src]

type Target = (Anchor<O0, E>, Anchor<O1, E>, Anchor<O2, E>, Anchor<O3, E>, Anchor<O4, E>, Anchor<O5, E>, Anchor<O6, E>)

impl<O0, O1, O2, O3, O4, O5, O6, O7, E> AnchorSplit<E> for Anchor<(O0, O1, O2, O3, O4, O5, O6, O7), E> where
    O0: Clone + PartialEq + 'static,
    O1: Clone + PartialEq + 'static,
    O2: Clone + PartialEq + 'static,
    O3: Clone + PartialEq + 'static,
    O4: Clone + PartialEq + 'static,
    O5: Clone + PartialEq + 'static,
    O6: Clone + PartialEq + 'static,
    O7: Clone + PartialEq + 'static,
    E: Engine
[src]

type Target = (Anchor<O0, E>, Anchor<O1, E>, Anchor<O2, E>, Anchor<O3, E>, Anchor<O4, E>, Anchor<O5, E>, Anchor<O6, E>, Anchor<O7, E>)

impl<O0, O1, O2, O3, O4, O5, O6, O7, O8, E> AnchorSplit<E> for Anchor<(O0, O1, O2, O3, O4, O5, O6, O7, O8), E> where
    O0: Clone + PartialEq + 'static,
    O1: Clone + PartialEq + 'static,
    O2: Clone + PartialEq + 'static,
    O3: Clone + PartialEq + 'static,
    O4: Clone + PartialEq + 'static,
    O5: Clone + PartialEq + 'static,
    O6: Clone + PartialEq + 'static,
    O7: Clone + PartialEq + 'static,
    O8: Clone + PartialEq + 'static,
    E: Engine
[src]

type Target = (Anchor<O0, E>, Anchor<O1, E>, Anchor<O2, E>, Anchor<O3, E>, Anchor<O4, E>, Anchor<O5, E>, Anchor<O6, E>, Anchor<O7, E>, Anchor<O8, E>)

impl<O, E: Engine> Clone for Anchor<O, E>[src]

impl<O, E: Engine> Eq for Anchor<O, E>[src]

impl<O, E: Engine> PartialEq<Anchor<O, E>> for Anchor<O, E>[src]

Auto Trait Implementations

impl<O, E: ?Sized> RefUnwindSafe for Anchor<O, E> where
    O: RefUnwindSafe,
    <E as Engine>::AnchorHandle: RefUnwindSafe

impl<O, E: ?Sized> Send for Anchor<O, E> where
    O: Send,
    <E as Engine>::AnchorHandle: Send

impl<O, E: ?Sized> Sync for Anchor<O, E> where
    O: Sync,
    <E as Engine>::AnchorHandle: Sync

impl<O, E: ?Sized> Unpin for Anchor<O, E> where
    O: Unpin,
    <E as Engine>::AnchorHandle: Unpin

impl<O, E: ?Sized> UnwindSafe for Anchor<O, E> where
    O: UnwindSafe,
    <E as Engine>::AnchorHandle: UnwindSafe

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.