pub struct ScopeId(pub usize);Expand description
A component’s unique identifier.
ScopeId is a usize that acts a key for the internal slab of Scopes. This means that the key is not unique across
time. We do try and guarantee that between calls to wait_for_work, no ScopeIds will be recycled in order to give
time for any logic that relies on these IDs to properly update.
Tuple Fields§
§0: usizeImplementations§
Source§impl ScopeId
impl ScopeId
Sourcepub const APP: ScopeId
pub const APP: ScopeId
The ScopeId of the main scope passed into crate::VirtualDom::new.
This scope will last for the entire duration of your app, making it convenient for long-lived state that is created dynamically somewhere down the component tree.
§Example
use dioxus::prelude::*;
let my_persistent_state = Signal::new_in_scope(String::new(), ScopeId::APP);Sourcepub const ROOT_ERROR_BOUNDARY: ScopeId
pub const ROOT_ERROR_BOUNDARY: ScopeId
The ScopeId of the topmost error boundary in the tree.
Sourcepub const ROOT_SUSPENSE_BOUNDARY: ScopeId
pub const ROOT_SUSPENSE_BOUNDARY: ScopeId
The ScopeId of the topmost suspense boundary in the tree.
Sourcepub const ROOT: ScopeId
pub const ROOT: ScopeId
The ScopeId of the topmost scope in the tree.
This will be higher up in the tree than ScopeId::APP because dioxus inserts a default crate::SuspenseBoundary and crate::ErrorBoundary at the root of the tree.