Crate singleton_cell[][src]

Modules

Macro-only code which must be public

Macros

Generates a new global singleton type with a fallible constructor. This is intended for cases where a single instance is created early in the program and passed throughout.

Structs

SCell, or SingletonCell provides an interface of a Ghost Cell, where the Key is allowed to be any singleton, rather than a particular token type.

A temporary singleton token created by the with_token function.

Traits

This trait denotes a type which has at most one logical identity at all times. This is sufficient to make borrowing decisions based only on the type, without regards to value identity.

Functions

Generate a local token type which is guaranteed to be a singleton via a unique lifetime brand. SCells can be created within this scope via SCell::new or SCell::from_mut and used via this token.

Type Definitions

A more verbose alias for SCell