Enum lrs::option::Option

An optional value.

Syntax

enum Option<T> {
    None,
    Some(T),
}

Variants

NameDescription
None

The value is not present.

Some

The value is present.

Methods

ReceiverNameDescription
&mut selfas_mut

Returns an Option containing an mutable reference to the value (if any.)

&selfas_ref

Returns an Option containing an immutable reference to the value (if any.)

selfchain

Applies a function to the value (if any) and returns the result.

&selfis_none

Returns whether this object does not contain a value.

&selfis_some

Returns whether this object contains a value.

selfmap

If the value is present, replaces it by the result of a function application.

&mut selftake

Replaces the value by None and returns the original.

selfunwrap

Unwraps the value or aborts.

selfunwrap_or

Unwraps the value or returns another one.

Trait implementations

NameDescription
Clone

Objects that can be duplicated.

Copy

Objects that can safely be copied via memcpy.

Eq

Objects that implement the binary == and != operators.

Hash

Objects that can be hashed.

Iterator

Objects that can be iterated over.

MaybeClone

Objects that can be duplicated.