Struct arc_swap::gen_lock::PrivateSharded [−][src]
pub struct PrivateSharded<S> { /* fields omitted */ }
Expand description
An alternative to PrivateUnsharded
, but with configurable number of shards.
The PrivateUnsharded
is almost identical to PrivateSharded<[Shard; 1]>
(the
implementation takes advantage of some details to avoid a little bit of overhead). It allows
the user to choose the trade-of between contention during locking and size of the pointer and
speed during writes.
Note on AsRef<[Shard]>
Rust provides the AsRef
trait (or, actually any trait) up to arrays of 32 elements. If you
need something bigger, you have to work around it with a newtype.
Trait Implementations
impl<S: Default> Default for PrivateSharded<S>
[src]
impl<S: Default> Default for PrivateSharded<S>
[src]fn default() -> PrivateSharded<S>
[src]
fn default() -> PrivateSharded<S>
[src]Returns the “default value” for a type. Read more
impl<S: AsRef<[Shard]> + Default> LockStorage for PrivateSharded<S>
[src]
impl<S: AsRef<[Shard]> + Default> LockStorage for PrivateSharded<S>
[src]fn gen_idx(&self) -> &AtomicUsize
[src]
fn gen_idx(&self) -> &AtomicUsize
[src]Access to the generation index. Read more
fn choose_shard(&self) -> usize
[src]
fn choose_shard(&self) -> usize
[src]Pick one shard of the all selected. Read more
Auto Trait Implementations
impl<S> RefUnwindSafe for PrivateSharded<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for PrivateSharded<S> where
S: Send,
S: Send,
impl<S> Sync for PrivateSharded<S> where
S: Sync,
S: Sync,
impl<S> Unpin for PrivateSharded<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for PrivateSharded<S> where
S: UnwindSafe,
S: UnwindSafe,