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

pub struct Shard(_);

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]

Auto Trait Implementations

impl Send for Shard

impl Sync for Shard

impl Unpin for Shard

impl UnwindSafe for Shard

impl RefUnwindSafe for Shard

Blanket Implementations

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

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

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.

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.

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

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

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