Struct lateinit::LateInit
[−]
[src]
pub struct LateInit<T>(_);
The primary type for this crate. Initialize before use.
Methods
impl<T> LateInit<T>
[src]
pub const fn new() -> Self
[src]
Create a new LateInit.
pub unsafe fn init(&self, value: T)
[src]
Assign a value. Panics if called more than once.
impl<T: Clone> LateInit<T>
[src]
pub fn clone(&self) -> T
[src]
Clone contained value. Panics in debug profile if called before initialization.
Note that Clone
is not implemented because LateInit
doesn't
support mutation, so clone_from
is impossible.
Trait Implementations
impl<T> Sync for LateInit<T>
[src]
impl<T> !Send for LateInit<T>
[src]
impl<T> Deref for LateInit<T>
[src]
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &T
[src]
Deref to contained value. Panics in debug if called before initialization.
impl<T> AsRef<T> for LateInit<T>
[src]
impl<T: PartialEq<W>, W> PartialEq<W> for LateInit<T>
[src]
fn eq(&self, other: &W) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &W) -> bool
[src]
This method tests for !=
.
impl<T: PartialOrd<W>, W> PartialOrd<W> for LateInit<T>
[src]
fn partial_cmp(&self, other: &W) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &W) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &W) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &W) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &W) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Debug> Debug for LateInit<T>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError>
[src]
Delegates to Debug
implementation on contained value. This is a checked access.