Module threading

Source
Expand description

Type definitions for putting shared ownership and synchronized mutation behind the threading feature toggle.

That way, single-threaded applications will not have to use thread-safe primitives, and simply do not specify the ‘threading’ feature.

Functions§

downgrade_mut_to_refparallel
Downgrade a handle previously obtained with get_mut() to drop mutation support.
get_mutparallel
Get a mutable reference through a MutableOnDemand for read-write access.
get_refparallel
Get a shared reference through a MutableOnDemand for read-only access.
lockparallel
Get a mutable reference through a Mutable for read-write access.
make_mutparallel
Get a mutable reference to the underlying data, with semantics similar to Arc::make_mut().
map_refparallel
Map a read guard into a sub-type it contains.

Type Aliases§

MappedRefGuardparallel
A mapped reference created from a RefGuard
Mutableparallel
A synchronization primitive which provides read-write access right away.
MutableOnDemandparallel
A synchronization primitive which can start read-only and transition to support mutation.
OnceCellparallel and once_cell
A thread-safe cell which can be written to only once.
OwnSharedparallel
A reference counted pointer type for shared ownership.
RefGuardparallel
A guarded reference suitable for safekeeping in a struct.