Enum lazy_mut::LazyMut [] [src]

pub enum LazyMut<T> {
    Init(fn() -> T),
    Value(T),
}

A mutable lazy value with either an initializer or a value

See the module-level documentation for more information on usage.

Variants

An initializer that will be run to obtain the first value

The value from the initializer

Methods

impl<T> LazyMut<T>
[src]

[src]

Returns the wrapped value, initializing if needed

[src]

Initializes the wrapped value if it is uninitialized

[src]

Initializes the wrapped value, panicking if it was already initialized

[src]

Tries to get a reference to the value, returns None if the value is uninitialized

Uses associated function syntax (LazyMut::get(&VAL))

[src]

Tries to get a mutable reference the value, returns None if the value is uninitialized

Uses associated function syntax (LazyMut::get_mut(&mut VAL))

[src]

Returns true if the wrapped value has been initialized

Trait Implementations

impl<T: Clone> Clone for LazyMut<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for LazyMut<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T> Deref for LazyMut<T>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl<T> DerefMut for LazyMut<T>
[src]

[src]

Mutably dereferences the value.

impl<T> Display for LazyMut<T> where
    T: Display
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T> Send for LazyMut<T> where
    T: Send

impl<T> Sync for LazyMut<T> where
    T: Sync