pub struct Scope { /* private fields */ }Expand description
Ownership scope for signals/effects (§4.3). Copy handle; not Send.
Implementations§
Source§impl Scope
impl Scope
pub fn current() -> Scope
pub fn root() -> Scope
pub fn create_child(self) -> Scope
pub fn on_cleanup(self, f: impl FnOnce() + 'static)
pub fn is_alive(self) -> bool
Sourcepub fn dispose(self)
pub fn dispose(self)
Dispose this scope: children first, then own nodes (unsubscribed + dropped) and cleanups.
Sourcepub fn provide<T>(self, value: T)where
T: 'static,
pub fn provide<T>(self, value: T)where
T: 'static,
Provide a context value visible to this scope and its descendants.
Sourcepub fn use_context<T>(self) -> Option<T>where
T: Clone + 'static,
pub fn use_context<T>(self) -> Option<T>where
T: Clone + 'static,
Look up a context value here or in any ancestor (requires T: Clone).
Trait Implementations§
impl Copy for Scope
impl Eq for Scope
impl StructuralPartialEq for Scope
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl !Send for Scope
impl !Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
Converts
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>
Converts
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