pub struct Scope { /* private fields */ }Implementations§
Source§impl Scope
impl Scope
pub fn new() -> Self
pub fn run<R>(&self, f: impl FnOnce() -> R) -> R
pub fn add_disposer(&self, disposer: impl FnOnce() + 'static)
Sourcepub fn memo<T: 'static>(&self, key: &str, init: impl FnOnce() -> T) -> Rc<T>
pub fn memo<T: 'static>(&self, key: &str, init: impl FnOnce() -> T) -> Rc<T>
Returns a cached value from this scope’s memo cache, or creates it with
init and stores it. The value persists for the lifetime of this scope
(i.e., until the scope key is no longer composed or the root is replaced).
pub fn child(&self) -> Scope
pub fn dispose(self)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Scope
impl !Send for Scope
impl !Sync for Scope
impl !UnwindSafe for Scope
impl Freeze for Scope
impl Unpin for Scope
impl UnsafeUnpin 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