pub struct ScopeId(pub usize);prelude only.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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ScopeId
impl<'de> Deserialize<'de> for ScopeId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScopeId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScopeId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Ord for ScopeId
impl Ord for ScopeId
Source§impl PartialOrd for ScopeId
impl PartialOrd for ScopeId
Source§impl Serialize for ScopeId
impl Serialize for ScopeId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for ScopeId
impl Eq for ScopeId
impl StructuralPartialEq for ScopeId
Auto Trait Implementations§
impl Freeze for ScopeId
impl RefUnwindSafe for ScopeId
impl Send for ScopeId
impl Sync for ScopeId
impl Unpin for ScopeId
impl UnwindSafe for ScopeId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more