Struct arc_swap::gen_lock::Shard [−][src]
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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 = 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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,