Struct bee_runtime::resource::ResourceHandle
source · [−]pub struct ResourceHandle<R> { /* private fields */ }
Expand description
An owning handle to a node resource.
Implementations
sourceimpl<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
sourceimpl<R> Clone for ResourceHandle<R>
impl<R> Clone for ResourceHandle<R>
sourceimpl<R> Deref for ResourceHandle<R>
impl<R> Deref for ResourceHandle<R>
Auto Trait Implementations
impl<R> RefUnwindSafe for ResourceHandle<R> where
R: RefUnwindSafe,
impl<R> Send for ResourceHandle<R> where
R: Send + Sync,
impl<R> Sync for ResourceHandle<R> where
R: Send + Sync,
impl<R> Unpin for ResourceHandle<R>
impl<R> UnwindSafe for ResourceHandle<R> where
R: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more