pub struct TaggedCell<T, Tag> { /* private fields */ }
Expand description

Top level structure to support initializable and thread safe static variables. Use tagged_cell! macro to make this struct

Implementations

Initialize a TaggedCell. This function initializes the cell, if not already initialized, using the provided function or closure. Additionally returns a zero-sized Tag, which is required to access the underlying data.

Each thread accessing a TaggedOnceCell should call this method to obtain a Tag, the initialization code will only run once. It is undetermined which thread will run the initialization code.

Get the data within a TaggedCell, requires an tag (obtained via TaggedCell::init) to perform the access

Trait Implementations

TaggedCell may be Sync. Guaranteed by ZST tag

TaggedCell may be Sync. Guaranteed by ZST tag

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.