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