pub struct ScopeStore {
pub set_fn: fn(Option<TaskScope>),
pub get_fn: fn() -> Option<TaskScope>,
}Expand description
A pluggable backend for per-task (or per-thread) scope storage.
The default implementation uses a thread-local cell, which is
sufficient for single-threaded Wasm environments. For multi-task
SSR runtimes (e.g. tokio) the host application should inject a
task-local implementation via set_scope_store.
Fields§
§set_fn: fn(Option<TaskScope>)Store a scope (or None to clear).
get_fn: fn() -> Option<TaskScope>Retrieve the current scope.
Auto Trait Implementations§
impl Freeze for ScopeStore
impl RefUnwindSafe for ScopeStore
impl Send for ScopeStore
impl Sync for ScopeStore
impl Unpin for ScopeStore
impl UnsafeUnpin for ScopeStore
impl UnwindSafe for ScopeStore
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