Struct bee_runtime::resource::ResourceHandle[][src]

pub struct ResourceHandle<R> { /* fields omitted */ }

An owning handle to a node resource.

Implementations

impl<R> ResourceHandle<R>[src]

pub fn new(res: R) -> Self[src]

Wrap the given resource into a ResourceHandle, providing shared immutable access to it.

pub fn into_weak(self) -> WeakHandle<R>[src]

Turn this owned resource handle into a weak non-owning handle.

pub fn try_unwrap(self) -> Option<R> where
    R: Any
[src]

Attempt to gain ownership over the resource, returning None if the resource is still in use.

Trait Implementations

impl<R> Clone for ResourceHandle<R>[src]

impl<R> Deref for ResourceHandle<R>[src]

type Target = R

The resulting type after dereferencing.

impl<R> Drop for ResourceHandle<R>[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for ResourceHandle<R> where
    R: RefUnwindSafe
[src]

impl<R> Send for ResourceHandle<R> where
    R: Send + Sync
[src]

impl<R> Sync for ResourceHandle<R> where
    R: Send + Sync
[src]

impl<R> Unpin for ResourceHandle<R>[src]

impl<R> UnwindSafe for ResourceHandle<R> where
    R: RefUnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.