A temporary storage of the pointer.
This guard object is returned from most loading methods (with the notable exception of
load_full). It dereferences to the smart pointer
loaded, so most operations are to be done using that.
impl<'a, T: RefCnt> Guard<'a, T>[src]
pub fn into_inner(lease: Self) -> T[src]
Converts it into the held value.
This, on occasion, may be a tiny bit faster than cloning the Arc or whatever is being held inside.
pub fn from_inner(inner: T) -> Self[src]
Create a guard for a given value
This can be useful on occasion to pass a specific object to code that expects or wants to store a Guard.
// Create two guards pointing to the same object let g1 = p.load(); let g2 = Guard::from_inner(Arc::clone(&*g1));
Auto Trait Implementations
impl<'l, T> RefUnwindSafe for Guard<'l, T> where
impl<'l, T> UnwindSafe for Guard<'l, T> where
A guard object containing the value and keeping it alive. Read more
type Error = Infallible
The type returned in the event of a conversion error.