Struct flo_binding::ComputedBinding
source · [−]pub struct ComputedBinding<Value: 'static + Clone, TFn> where
TFn: 'static + Fn() -> Value, { /* private fields */ }
Expand description
Represents a binding to a value that is computed by a function
Implementations
sourceimpl<Value: 'static + Clone + Send, TFn> ComputedBinding<Value, TFn> where
TFn: 'static + Send + Sync + Fn() -> Value,
impl<Value: 'static + Clone + Send, TFn> ComputedBinding<Value, TFn> where
TFn: 'static + Send + Sync + Fn() -> Value,
sourcepub fn new(calculate_value: TFn) -> ComputedBinding<Value, TFn>
pub fn new(calculate_value: TFn) -> ComputedBinding<Value, TFn>
Creates a new computable binding
sourcepub fn new_in_context(calculate_value: TFn) -> ComputedBinding<Value, TFn>
pub fn new_in_context(calculate_value: TFn) -> ComputedBinding<Value, TFn>
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
sourceimpl<Value: 'static + Clone + Send, TFn> Bound<Value> for ComputedBinding<Value, TFn> where
TFn: 'static + Send + Sync + Fn() -> Value,
impl<Value: 'static + Clone + Send, TFn> Bound<Value> for ComputedBinding<Value, TFn> where
TFn: 'static + Send + Sync + Fn() -> Value,
sourceimpl<Value: 'static + Clone, TFn> Changeable for ComputedBinding<Value, TFn> where
TFn: 'static + Send + Sync + Fn() -> Value,
impl<Value: 'static + Clone, TFn> Changeable for ComputedBinding<Value, TFn> where
TFn: 'static + Send + Sync + Fn() -> Value,
sourcefn when_changed(&self, what: Arc<dyn Notifiable>) -> Box<dyn Releasable>
fn when_changed(&self, what: Arc<dyn Notifiable>) -> Box<dyn Releasable>
Supplies a function to be notified when this item is changed Read more
sourceimpl<Value: 'static + Clone + Send, TFn> Clone for ComputedBinding<Value, TFn> where
TFn: 'static + Send + Sync + Fn() -> Value,
impl<Value: 'static + Clone + Send, TFn> Clone for ComputedBinding<Value, TFn> where
TFn: 'static + Send + Sync + Fn() -> Value,
Auto Trait Implementations
impl<Value, TFn> RefUnwindSafe for ComputedBinding<Value, TFn>
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,
impl<Value, TFn> Unpin for ComputedBinding<Value, TFn>
impl<Value, TFn> UnwindSafe for ComputedBinding<Value, TFn>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more