pub struct Re<T: Convenient>(_);Expand description
A helper struct, assisting to keep reactive code reentrant.
Dropping this value (e.g. with let _ = ...) most likely is a reentrancy violation.
Functions returning Re could not be called in a row in general case
without special precautions resulting in the adding a queue.
If you need to “split” control flow and perform several actions, use intermediate dependecy property/event. Each dependency property/event has an inner queue and support multiply listeners.
Implementations
sourceimpl<T: Convenient> Re<T>
impl<T: Convenient> Re<T>
sourcepub fn Yield(value: T) -> Re<T>
pub fn Yield(value: T) -> Re<T>
Wraps value into the Re helper struct, allowing
to return it from reactive callback.
Such callback are required, for example,
by BindingExt constructor’s dispatch argument
(see BindingExt1::new, BindingExt2::new, …).
sourcepub const Continue: Re<T> = Re(None)
pub const Continue: Re<T> = Re(None)
An instance with no value.
It indends to prevent remaining processing of current reactive action.
For example, it can be used in BindingExt constructor’s dispatch argument
(see BindingExt1::new, BindingExt2::new, …)
to prevent going value into the binding target.
Also it can be used as Re<!> instance in places where no further reactive
processing supposed, such as in a BindingBase::dispatch / Binding::dispatch
callback.
sourceimpl Re<!>
impl Re<!>
sourcepub fn immediate(self)
pub fn immediate(self)
Explicitely drops Re with no value, allowing to call
functions returning Re in any context.
This could breaks code piece reenterability, so it
is supposed to use in places, where it is garanteed to
be not a problem, e.g. in main function (or any other
place which executes once).
Auto Trait Implementations
impl<T> RefUnwindSafe for Re<T> where
T: RefUnwindSafe,
impl<T> Send for Re<T> where
T: Send,
impl<T> Sync for Re<T> where
T: Sync,
impl<T> Unpin for Re<T> where
T: Unpin,
impl<T> UnwindSafe for Re<T> where
T: UnwindSafe,
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
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more