pub struct Runtime { /* private fields */ }Expand description
The runtime: every signal and binding of one page (or one test).
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn signal<T: Clone + PartialEq + 'static>(&self, value: T) -> Signal<T>
pub fn signal<T: Clone + PartialEq + 'static>(&self, value: T) -> Signal<T>
A signal holding value.
Sourcepub fn bind(&self, f: impl FnMut() + 'static) -> BindingId
pub fn bind(&self, f: impl FnMut() + 'static) -> BindingId
Runs f now, tracking the signals it reads, and again whenever one
of them changes.
Sourcepub fn dispose(&self, id: BindingId)
pub fn dispose(&self, id: BindingId)
Stops the binding: it never runs again, and its reads are forgotten.
Sourcepub fn batch<R>(&self, f: impl FnOnce() -> R) -> R
pub fn batch<R>(&self, f: impl FnOnce() -> R) -> R
Runs f with every set inside it batched: each binding runs once
after f, however many of its signals moved.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Runtime
impl !Send for Runtime
impl !Sync for Runtime
impl !UnwindSafe for Runtime
impl Forget for Runtime
impl Freeze for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant trait object to Box<dyn Any>.