[][src]Struct flo_binding::ComputedBinding

pub struct ComputedBinding<Value: 'static + Clone, TFn> where
    TFn: 'static + Fn() -> Value, 
{ /* fields omitted */ }

Represents a binding to a value that is computed by a function

Methods

impl<Value: 'static + Clone + Send, TFn> ComputedBinding<Value, TFn> where
    TFn: 'static + Send + Sync + Fn() -> Value, 
[src]

pub fn new(calculate_value: TFn) -> ComputedBinding<Value, TFn>[src]

Creates a new computable binding

pub fn new_in_context(calculate_value: TFn) -> ComputedBinding<Value, TFn>[src]

Creates a new computable binding within another binding

Normally this is considered an error (if the binding is not held anywhere outside of the context, it will never generate an update). new panics if it's called from within a context for this reason.

If the purpose of a computed binding is to return other bindings, this limitation does not apply, so this call is available

Trait Implementations

impl<Value: 'static + Clone, TFn> Changeable for ComputedBinding<Value, TFn> where
    TFn: 'static + Send + Sync + Fn() -> Value, 
[src]

impl<Value: 'static + Clone + Send, TFn> Bound<Value> for ComputedBinding<Value, TFn> where
    TFn: 'static + Send + Sync + Fn() -> Value, 
[src]

impl<Value: 'static + Clone + PartialEq + Send, TFn> From<ComputedBinding<Value, TFn>> for BindRef<Value> where
    TFn: 'static + Send + Sync + Fn() -> Value, 
[src]

impl<'a, Value: 'static + Clone + PartialEq + Send, TFn> From<&'a ComputedBinding<Value, TFn>> for BindRef<Value> where
    TFn: 'static + Send + Sync + Fn() -> Value, 
[src]

impl<Value: 'static + Clone + Send, TFn> Clone for ComputedBinding<Value, TFn> where
    TFn: 'static + Send + Sync + Fn() -> Value, 
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<Value, TFn> Send for ComputedBinding<Value, TFn> where
    TFn: Send,
    Value: Send

impl<Value, TFn> Sync for ComputedBinding<Value, TFn> where
    TFn: Send,
    Value: Send

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.