pub struct ReactiveRuntime { /* private fields */ }Expand description
Implementations§
Source§impl ReactiveRuntime
impl ReactiveRuntime
Sourcepub fn signal<T: Send + Sync + Clone + 'static>(&self, initial: T) -> Signal<T>
pub fn signal<T: Send + Sync + Clone + 'static>(&self, initial: T) -> Signal<T>
Create a new Signal holding initial.
The returned handle is lightweight; clone it freely.
Sourcepub fn computed<T: Send + Sync + Clone + 'static>(
&self,
f: impl Fn() -> T + Send + Sync + 'static,
) -> Result<Computed<T>, ReactiveError>
pub fn computed<T: Send + Sync + Clone + 'static>( &self, f: impl Fn() -> T + Send + Sync + 'static, ) -> Result<Computed<T>, ReactiveError>
Create a new Computed whose value is derived by calling f.
The thunk f is called lazily on the first get() and whenever the
cached value is stale. Dependency edges are registered automatically
when f calls .get() on signals or other computeds.
Returns Err(ReactiveError::DependencyCycle) if a cycle is detected on
the first evaluation (not possible via the safe public API).
Trait Implementations§
Source§impl Clone for ReactiveRuntime
impl Clone for ReactiveRuntime
Source§fn clone(&self) -> ReactiveRuntime
fn clone(&self) -> ReactiveRuntime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ReactiveRuntime
impl RefUnwindSafe for ReactiveRuntime
impl Send for ReactiveRuntime
impl Sync for ReactiveRuntime
impl Unpin for ReactiveRuntime
impl UnsafeUnpin for ReactiveRuntime
impl UnwindSafe for ReactiveRuntime
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