Struct arc_swap::Guard [−][src]
pub struct Guard<T: RefCnt, S: Strategy<T> = DefaultStrategy> { /* fields omitted */ }
Expand description
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.
Implementations
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.
Create a guard for a given value inner
.
This can be useful on occasion to pass a specific object to code that expects or wants to store a Guard.
Example
// Create two guards pointing to the same object
let g1 = p.load();
let g2 = Guard::<_, DefaultStrategy>::from_inner(Arc::clone(&*g1));