pub struct ScopedResource<T> { /* private fields */ }Expand description
An IScopedResource that runs an action when it is disposed.
Implementations§
Source§impl<T: Clone + 'static> ScopedResource<T>
impl<T: Clone + 'static> ScopedResource<T>
pub fn create( value: T, dispose: impl FnOnce() + 'static, ) -> Rc<dyn IScopedResource<T>>
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for ScopedResource<T>
impl<T> !RefUnwindSafe for ScopedResource<T>
impl<T> !Send for ScopedResource<T>
impl<T> !Sync for ScopedResource<T>
impl<T> !UnwindSafe for ScopedResource<T>
impl<T> Unpin for ScopedResource<T>
impl<T> UnsafeUnpin for ScopedResource<T>
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more