Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Optional ¶
type Optional[T any] struct { // contains filtered or unexported fields }
Optional is a type that represents an optional value
func CastInt ¶
func CastInt[A, B constraints.Integer](a Optional[A]) (out Optional[B])
CastInt converts an integer optional value to another type
func (Optional[T]) Get ¶
Get returns the optional value and a boolean indicating if the value is set
func (Optional[T]) GetOr ¶
func (o Optional[T]) GetOr(def T) T
GetOr returns the optional value or a default value if the value is not set
Click to show internal directories.
Click to hide internal directories.