pub struct ServerRuntime(/* private fields */);
Expand description
A runtime meant to be used client-side because there can only be one per thread.
use reactive_signals::{Scope, signal, runtimes::ServerRuntime};
// when starting a server you create a root scope
let sc = ServerRuntime::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 ServerRuntime as well.
sc.discard();
fn app(sc: Scope<ServerRuntime>) {
// a signal marked with `client` will not run in a Scope<ServerRuntime>
let sig = signal!(sc, client, move || println!("client!"));
}
See runtimes for full documentation.
Implementations§
Source§impl ServerRuntime
impl ServerRuntime
pub fn new_root_scope() -> Scope<ServerRuntime>
Trait Implementations§
Source§impl Clone for ServerRuntime
impl Clone for ServerRuntime
Source§fn clone(&self) -> ServerRuntime
fn clone(&self) -> ServerRuntime
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 ServerRuntime
impl Default for ServerRuntime
Source§fn default() -> ServerRuntime
fn default() -> ServerRuntime
Returns the “default value” for a type. Read more
impl Copy for ServerRuntime
Auto Trait Implementations§
impl Freeze for ServerRuntime
impl RefUnwindSafe for ServerRuntime
impl Send for ServerRuntime
impl Sync for ServerRuntime
impl Unpin for ServerRuntime
impl UnwindSafe for ServerRuntime
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