#[repr(transparent)]
pub struct AtomicBorrow { /* private fields */ }
Expand description

An atomic reference counter.

Implementations

The mask for the shared borrow count.

The mask for the unique borrow bit.

Creates a new AtomicBorrow.

Returns number of shared borrows.

Returns true if self is uniquely borrowed.

Returns true if self is borrowed in any way.

Tries to acquire a shared reference.

Returns true if the reference was acquired.

Tries to acquire a unique reference.

Returns true if the reference was acquired.

Releases a shared reference.

Panics.
  • If self is not borrowed. Only with debug_assertions enabled.
  • If self is uniquely borrowed. Only with debug_assertions enabled.

Releases a unique reference.

Panics.
  • If self is not uniquely borrowed. Only with debug_assertions enabled.

Spins until a shared reference can be acquired.

Spins until a unique reference can be acquired.

Trait Implementations

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. 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.