pub struct OneTime<T> { /* fields omitted */ }
Encapsulation of a RwLock<Option> for one-time initialization.
This implementation will purposefully fail hard if not used
properly, for example if not initialized before being first used
(borrowed).
Builds a new uninitialized OneTime.
Initializes the OneTime, should only be called once after construction.
Will panic (via assert) if called more than once.
Borrows the OneTime, should only be called after initialization.
Will panic (via expect) if called before initialization.
Performs copy-assignment from source
. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
impl<T> CloneAny for T where T: Clone + Any, | |
impl<T> UnsafeAny for T where T: Any, | |