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: 'static>(self, value: T)
pub fn provide<T: 'static>(self, value: T)
Provide a context value visible to this scope and its descendants.
Sourcepub fn use_context<T: Clone + 'static>(self) -> Option<T>
pub fn use_context<T: Clone + 'static>(self) -> Option<T>
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§
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