#[repr(transparent)]
pub struct Guard<'a, T>(_);
Expand description
Guards that a referenced ThreadCell
becomes properly released when its guard becomes
dropped. This covers releasing threadcells on panic. Guards do not prevent the explicit
release of a ThreadCell
. Deref a Guard
referencing a released ThreadCell
will panic!
One can deref a Guard
as long the ThreadCell
is owned by the current thread this
should be the case as long the guarded ThreadCell
got not explicitly released or stolen.
When the underlying ThreadCell
is not owned by the current thread.
The resulting type after dereferencing.
Dereferences the value.
Releases the referenced ThreadCell
when it is owned by the current thread.
Executes the destructor for this type.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.