pub struct ResourceHandle<R> { /* private fields */ }
Expand description
An owning handle to a node resource.
Implementations§
Source§impl<R> ResourceHandle<R>
impl<R> ResourceHandle<R>
Sourcepub fn new(res: R) -> Self
pub fn new(res: R) -> Self
Wrap the given resource into a ResourceHandle
, providing shared immutable access to it.
Sourcepub fn into_weak(self) -> WeakHandle<R>
pub fn into_weak(self) -> WeakHandle<R>
Turn this owned resource handle into a weak non-owning handle.
Sourcepub fn try_unwrap(self) -> Option<R>where
R: Any,
pub fn try_unwrap(self) -> Option<R>where
R: Any,
Attempt to gain ownership over the resource, returning None
if the resource is still in use.
Trait Implementations§
Source§impl<R> Clone for ResourceHandle<R>
impl<R> Clone for ResourceHandle<R>
Source§impl<R> Deref for ResourceHandle<R>
impl<R> Deref for ResourceHandle<R>
Auto Trait Implementations§
impl<R> Freeze for ResourceHandle<R>
impl<R> RefUnwindSafe for ResourceHandle<R>where
R: RefUnwindSafe,
impl<R> Send for ResourceHandle<R>
impl<R> Sync for ResourceHandle<R>
impl<R> Unpin for ResourceHandle<R>
impl<R> UnwindSafe for ResourceHandle<R>where
R: RefUnwindSafe,
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