pub struct BindingContext { /* private fields */ }Expand description
Represents a binding context. Binding contexts are
per-thread structures, used to track which bindings
have been accessed in a computed() function.
Implementations§
Source§impl BindingContext
impl BindingContext
Sourcepub fn current() -> Option<BindingContext>
pub fn current() -> Option<BindingContext>
Gets the active binding context
Sourcepub fn panic_if_in_binding_context(msg: &str)
pub fn panic_if_in_binding_context(msg: &str)
Panics if we’re trying to create a binding, with a particular message
Sourcepub fn bind<TResult, TFn>(to_do: TFn) -> (TResult, BindingDependencies)where
TFn: FnOnce() -> TResult,
pub fn bind<TResult, TFn>(to_do: TFn) -> (TResult, BindingDependencies)where
TFn: FnOnce() -> TResult,
Executes a function in a new binding context
Sourcepub fn out_of_context<TResult, TFn>(to_do: TFn) -> TResultwhere
TFn: FnOnce() -> TResult,
pub fn out_of_context<TResult, TFn>(to_do: TFn) -> TResultwhere
TFn: FnOnce() -> TResult,
Performs an action outside of the binding context (dependencies will not be tracked for anything the supplied function does)
Sourcepub fn add_dependency<TChangeable: Changeable + 'static>(
dependency: TChangeable,
)
pub fn add_dependency<TChangeable: Changeable + 'static>( dependency: TChangeable, )
Adds a dependency to the current context (if one is found)
Trait Implementations§
Source§impl Clone for BindingContext
impl Clone for BindingContext
Source§fn clone(&self) -> BindingContext
fn clone(&self) -> BindingContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BindingContext
impl !RefUnwindSafe for BindingContext
impl !Send for BindingContext
impl !Sync for BindingContext
impl Unpin for BindingContext
impl !UnwindSafe for BindingContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more