dstruct.option

This module defines an Option!T type and a related Some!T type for dealing nullable data in a safe manner.

Members

Functions

option
inout(Option!T) option(inout(T) value)
inout(Option!T) option(inout(Some!T) value)

A helper function for constructing Option!T values.

range
OptionRange!T range(Option!T optionalValue)
OptionRange!(const(T)) range(const(Option!T) optionalValue)
OptionRange!(immutable(T)) range(immutable(Option!T) optionalValue)

Create an OptionRange from an Option type.

some
inout(Some!T) some(inout(T) value)

A helper function for constructing Some!T values.

Structs

Option
struct Option(T)

This type represents an optional value for T.

OptionRange
struct OptionRange(T)

This type represents a range over an optional type.

Some
struct Some(T)

This type represents a value which cannot be null by its contracts.

Meta