Struct safe_cell::SafeCell[][src]

pub struct SafeCell<T> { /* fields omitted */ }
Expand description

The SafeCell type.

See the module-level documentation for more information.

Implementations

Returns a shared reference to the wrapped value.

Returns a mutable reference to the wrapped value.

Using this reference, the value can be safely mutated. Using the type-level mechanism provided by exterior mutability, SafeCell guarantees that no unsound concurrent access can occur.

Extracts and returns the wrapped value.

Note that this method must not be called concurrently, and once into_inner is called, references obtained by get and get_mut must no longer be used. This is statically ensured.

Create a new SafeCell, enabling exterior mutability for the passed value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.