pub struct PrivateSharded<S> { /* private fields */ }
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§

Returns the “default value” for a type. Read more
The type for keeping several shards. Read more
Access to the generation index. Read more
Access to the shards storage. Read more
Pick one shard of the all selected. 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.