Struct dangerous_option::DangerousOption [] [src]

pub struct DangerousOption<T, H: ExceptionHandler = DefaultExceptionHandler>(_, _);

Represents a value that might be uninitialized, but most probably isn't. It provides convenient access to the value via Deref while checking whether the value is actually initialized.

When deref of initialized value is attempted, the ExceptionHandler is called. This will lead to aborting of the task.

Methods

impl<T, H: ExceptionHandler> DangerousOption<T, H>
[src]

[src]

Creates valid value.

[src]

Creates uninitialized value.

[src]

Takes out the value, failing if it's not there. After call to this function, the value is uninitialized.

[src]

Tries to take out the value. After call to this function, the value is uninitialized.

[src]

Non-panicking version of deref, which returns None, if value is uninitiaized.

[src]

Non-panicking version of deref_mut, which returns None, if value is uninitiaized.

[src]

Puts the new value in place of old, optionally returning old value.

Trait Implementations

impl<T: Debug, H: Debug + ExceptionHandler> Debug for DangerousOption<T, H>
[src]

[src]

Formats the value using the given formatter.

impl<T, H: ExceptionHandler> Deref for DangerousOption<T, H>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl<T, H: ExceptionHandler> DerefMut for DangerousOption<T, H>
[src]

[src]

Mutably dereferences the value.

impl<T> Clone for DangerousOption<T> where
    T: Clone
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more