Crate singleton_cell
source · [−]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
The Erased struct witnesses the logical ownership of a value of type T while remaining zero-sized. This can be used for ghost proofs of soundness.
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
The Exists trait is intended to be used with impl
, to denote
an argument where the existence of a value is sufficient as an argument
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