Struct arc_swap::gen_lock::Shard[][src]

#[repr(align(64))]
pub struct Shard(_);
Expand description

A single shard.

This is one copy of place where the library keeps tracks of generation locks. It consists of a pair of counters and allows double-buffering readers (therefore, even if there’s a never-ending stream of readers coming in, writer will get through eventually).

To avoid contention and sharing of the counters between readers, we don’t have one pair of generation counters, but several. The reader picks one shard and uses that, while the writer looks through all of them. This is still not perfect (two threads may choose the same ID), but it helps.

Each LockStorage must provide a (non-empty) array of these.

Trait Implementations

impl Default for Shard[src]

fn default() -> Shard[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

impl RefUnwindSafe for Shard

impl Send for Shard

impl Sync for Shard

impl Unpin for Shard

impl UnwindSafe for Shard

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.