None<T> class
None
is a type that represents not having a value.
Constructors
- None()
-
const
Properties
Methods
-
and<
U> (Option< U> optb) → Option<U> -
Returns None if the option is None, otherwise returns
optb
.inherited -
andThen<
U> (Option< U> f(T value)) → Option<U> -
Returns None if the option is None, otherwise calls
f
with the wrapped value and returns the result.inherited -
expect(
String msg) → T -
Returns the contained Some value, consuming the
this
value.inherited -
filter(
bool predicate(T value)) → Option< T> -
Returns None if the option is None, otherwise calls
predicate
with the wrapped value and returns:inherited -
iter(
) → Iterable< T> -
Returns an iterable over the possibly contained value.
inherited
-
map<
U> (U op(T value)) → Option< U> -
Maps an
Option<T>
toOption<U>
by applying a function to a contained value.inherited -
mapOr<
U> (U defaultValue, U f(T value)) → U -
Returns the provided default (if None), or
applies a function to the contained value (if Some),
inherited
-
mapOrElse<
U> (U defaultF(), U f(T value)) → U -
Computes a default function result (if None), or
applies a different function to the contained value (if Some).
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
okOr<
E> (E err) → Result< T, E> -
Transforms the Option into a Result, mapping
Some(v)
toOk(v)
andNone
toErr(err)
.inherited -
okOrElse<
E> (E err()) → Result< T, E> -
Transforms the Option into a Result, mapping
Some(v)
toOk(v)
andNone
toErr(err())
.inherited -
or(
Option< T> optb) → Option<T> -
Returns the option if it contains a value, otherwise returns
optb
.inherited -
orElse(
Option< T> f()) → Option<T> -
Returns the option if it contains a value, otherwise calls
f
and returns the result.inherited -
some(
) → T? -
Converts from
Option<T>
toT?
.inherited -
toString(
) → String -
A string representation of this object.
override
-
unwrap(
) → T -
Returns the contained Some value, consuming the
this
value.inherited -
unwrapOr(
T defaultValue) → T -
Returns the contained Some value or a provided default.
inherited
-
unwrapOrElse(
T op()) → T -
Returns the contained Some value or computes it from a closure.
inherited
-
xor(
Option< T> optb) → Option<T> -
Returns Some if exactly one of
this
,optb
is Some, otherwise returns None.inherited -
zip<
U> (Option< U> other) → Option<Tuple2< T, U> > -
Zips
this
with anotherOption
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override