pub struct ClientRuntime;
Expand description
A runtime meant to be used client-side because there can only be one per thread.
use reactive_signals::{Scope, signal, runtimes::ClientRuntime};
// when starting a client you create the root scope
let sc = ClientRuntime::new_root_scope();
// this scope is then used for building a tree of scopes.
app(sc);
// calling discard() on the root scope will discard the ClientRuntime as well.
sc.discard();
fn app(sc: Scope<ClientRuntime>) {
// a signal marked with `server` will not run in a Scope<ClientRuntime>
let sig = signal!(sc, server, move || println!("server!"));
}
See runtimes for full documentation.
Implementations§
Source§impl ClientRuntime
impl ClientRuntime
pub fn new_root_scope() -> Scope<ClientRuntime>
Trait Implementations§
Source§impl Clone for ClientRuntime
impl Clone for ClientRuntime
Source§fn clone(&self) -> ClientRuntime
fn clone(&self) -> ClientRuntime
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for ClientRuntime
impl Default for ClientRuntime
Source§fn default() -> ClientRuntime
fn default() -> ClientRuntime
Returns the “default value” for a type. Read more
impl Copy for ClientRuntime
Auto Trait Implementations§
impl Freeze for ClientRuntime
impl RefUnwindSafe for ClientRuntime
impl Send for ClientRuntime
impl Sync for ClientRuntime
impl Unpin for ClientRuntime
impl UnwindSafe for ClientRuntime
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