pub struct UnSyncLockedLazy<T, G = fn() -> T> { /* private fields */ }
Expand description

A RefCell that initializes its content on the first access

Implementations

Returns the current phase and synchronize with the end of the transition to the returned phase.

Initialize if necessary and returns a read lock

Panic

Panics if initialization panics or if initialization has panicked in a previous attempt to initialize.

Initialize if necessary and returns some read lock if the lazy is not already write locked. If the lazy is already write locked it returns None

Panic

If locks succeeds, panics if initialization panics or if initialization has panicked in a previous attempt to initialize.

Get a read lock if the lazy is initialized or an AccessError

if the lazy is not already write locked: get a read lock if the lazy is initialized or an AccessError. Otherwise returns None

Initialize if necessary and returns a write lock

Panic

Panics if initialization panics or if initialization has panicked in a previous attempt to initialize.

Initialize if necessary and returns some write lock if the lazy is not already write locked. If the lazy is already read or write locked it returns None

Panic

If locks succeeds, panics if initialization panics or if initialization has panicked in a previous attempt to initialize.

Get a read lock if the lazy is initialized or an AccessError

if the lazy is not already read or write locked: get a write lock if the lazy is initialized or an AccessError . Otherwise returns None

Initialize the lazy if no previous attempt to initialized it where performed

Build a new static object.

Safety

This function may be unsafe if build this object as anything else than a static or a thread local static would be the cause of undefined behavior

Build a new static object with debug informations.

Safety

This function may be unsafe if build this object as anything else than a static or a thread local static would be the cause of undefined behavior

Initialize and return a mutable reference to the target

This method is extremly efficient as it does not requires any form of locking when initializing

Return a mutable reference to the target if initialized otherwise return an error.

This method is extremly efficient as it does not requires any form of locking when initializing

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Executes the destructor for this type. Read more

return the current phase

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.