[−][src]Struct run_down::RundownRef
Tracks the status of run-down protection for an object. The type would be embedded in the object needing run-down protection.
Methods
impl RundownRef
[src]
pub fn new() -> Self
[src]
Initializes a new RundownRef
.
pub fn re_init(&self)
[src]
Re-initialize this instance so it can be used again. It is only valid to call re_init once the object is completely run-down, via the wait_for_rundown method.
Important
The moment this method returns, new rundown protection requests can succeed. You must perform all re-initialization of the shared object the run-down protection is guarding before you call this method.
pub fn try_acquire(&self) -> Result<RundownGuard, RundownError>
[src]
Attempts to acquire rundown protection on this RundownRef
,
returns the RundownGuard
which holds the reference count,
or returns an error if the object is already being rundown.
pub fn release(&self)
[src]
Release previously acquired rundown protection.
pub fn wait_for_rundown(&self)
[src]
Blocks thread execution until their are no outstanding reference
counts taken on the RundownRef
, and the internal representation
has been marked with [RundownFlags::RUNDOWN_IN_PROGRESS
] to signal
that no other thread can safely acquire a reference count afterwards.
Trait Implementations
impl Default for RundownRef
[src]
fn default() -> RundownRef
[src]
Auto Trait Implementations
impl Send for RundownRef
impl Sync for RundownRef
impl Unpin for RundownRef
impl UnwindSafe for RundownRef
impl !RefUnwindSafe for RundownRef
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,