option

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2020 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct {
	// contains filtered or unexported fields
}

Bool wraps an bool value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewBool

func NewBool(val bool) Bool

NewBool creates a new bool option wrapping the given value.

func NewEmptyBool

func NewEmptyBool() Bool

NewEmptyBool creates a new empty bool option.

func NewMaybeBool

func NewMaybeBool(val *bool) Bool

NewMaybeBool creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func (Bool) ForceMapToByte

func (o Bool) ForceMapToByte(fn func(bool) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Bool) ForceMapToComplex128

func (o Bool) ForceMapToComplex128(fn func(bool) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Bool) ForceMapToComplex64

func (o Bool) ForceMapToComplex64(fn func(bool) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Bool) ForceMapToFloat32

func (o Bool) ForceMapToFloat32(fn func(bool) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Bool) ForceMapToFloat64

func (o Bool) ForceMapToFloat64(fn func(bool) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Bool) ForceMapToInt

func (o Bool) ForceMapToInt(fn func(bool) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Bool) ForceMapToInt16

func (o Bool) ForceMapToInt16(fn func(bool) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Bool) ForceMapToInt32

func (o Bool) ForceMapToInt32(fn func(bool) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Bool) ForceMapToInt64

func (o Bool) ForceMapToInt64(fn func(bool) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Bool) ForceMapToInt8

func (o Bool) ForceMapToInt8(fn func(bool) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Bool) ForceMapToRune

func (o Bool) ForceMapToRune(fn func(bool) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Bool) ForceMapToString

func (o Bool) ForceMapToString(fn func(bool) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Bool) ForceMapToUint

func (o Bool) ForceMapToUint(fn func(bool) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Bool) ForceMapToUint16

func (o Bool) ForceMapToUint16(fn func(bool) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Bool) ForceMapToUint32

func (o Bool) ForceMapToUint32(fn func(bool) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Bool) ForceMapToUint64

func (o Bool) ForceMapToUint64(fn func(bool) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Bool) ForceMapToUint8

func (o Bool) ForceMapToUint8(fn func(bool) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Bool) ForceMapToUntyped

func (o Bool) ForceMapToUntyped(fn func(bool) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Bool) Get

func (o Bool) Get() bool

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Bool) IsNil

func (o Bool) IsNil() bool

IsNil returns whether or not this option is empty.

func (Bool) IsPresent

func (o Bool) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Bool) MapToByte

func (o Bool) MapToByte(fn func(bool) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Bool) MapToComplex128

func (o Bool) MapToComplex128(fn func(bool) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Bool) MapToComplex64

func (o Bool) MapToComplex64(fn func(bool) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Bool) MapToFloat32

func (o Bool) MapToFloat32(fn func(bool) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Bool) MapToFloat64

func (o Bool) MapToFloat64(fn func(bool) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Bool) MapToInt

func (o Bool) MapToInt(fn func(bool) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Bool) MapToInt16

func (o Bool) MapToInt16(fn func(bool) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Bool) MapToInt32

func (o Bool) MapToInt32(fn func(bool) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Bool) MapToInt64

func (o Bool) MapToInt64(fn func(bool) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Bool) MapToInt8

func (o Bool) MapToInt8(fn func(bool) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Bool) MapToNillable

func (o Bool) MapToNillable(fn func(bool) *bool) Bool

MapToNillable either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Bool) MapToNillableByte

func (o Bool) MapToNillableByte(fn func(bool) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Bool) MapToNillableComplex128

func (o Bool) MapToNillableComplex128(fn func(bool) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableComplex64

func (o Bool) MapToNillableComplex64(fn func(bool) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableFloat32

func (o Bool) MapToNillableFloat32(fn func(bool) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableFloat64

func (o Bool) MapToNillableFloat64(fn func(bool) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableInt

func (o Bool) MapToNillableInt(fn func(bool) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Bool) MapToNillableInt16

func (o Bool) MapToNillableInt16(fn func(bool) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableInt32

func (o Bool) MapToNillableInt32(fn func(bool) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableInt64

func (o Bool) MapToNillableInt64(fn func(bool) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableInt8

func (o Bool) MapToNillableInt8(fn func(bool) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableRune

func (o Bool) MapToNillableRune(fn func(bool) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Bool) MapToNillableString

func (o Bool) MapToNillableString(fn func(bool) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Bool) MapToNillableUint

func (o Bool) MapToNillableUint(fn func(bool) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Bool) MapToNillableUint16

func (o Bool) MapToNillableUint16(fn func(bool) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableUint32

func (o Bool) MapToNillableUint32(fn func(bool) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableUint64

func (o Bool) MapToNillableUint64(fn func(bool) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableUint8

func (o Bool) MapToNillableUint8(fn func(bool) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Bool) MapToNillableUntyped

func (o Bool) MapToNillableUntyped(fn func(bool) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Bool) MapToRune

func (o Bool) MapToRune(fn func(bool) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Bool) MapToString

func (o Bool) MapToString(fn func(bool) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Bool) MapToUint

func (o Bool) MapToUint(fn func(bool) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Bool) MapToUint16

func (o Bool) MapToUint16(fn func(bool) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Bool) MapToUint32

func (o Bool) MapToUint32(fn func(bool) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Bool) MapToUint64

func (o Bool) MapToUint64(fn func(bool) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Bool) MapToUint8

func (o Bool) MapToUint8(fn func(bool) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Bool) MapToUntyped

func (o Bool) MapToUntyped(fn func(bool) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Bool) Or

func (o Bool) Or(def bool) bool

Or returns either the value stored in this option or the given default value.

func (Bool) OrGet

func (o Bool) OrGet(fn func() bool) bool

OrGet returns either the value stored in this option or result of calling the given function.

func (Bool) OrPanicWith

func (o Bool) OrPanicWith(fn func() interface{}) bool

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Bool) OrPanicWithVal

func (o Bool) OrPanicWithVal(err interface{}) bool

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Byte

type Byte struct {
	// contains filtered or unexported fields
}

Byte wraps an byte value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewByte

func NewByte(val byte) Byte

NewByte creates a new byte option wrapping the given value.

func NewEmptyByte

func NewEmptyByte() Byte

NewEmptyByte creates a new empty byte option.

func NewMaybeByte

func NewMaybeByte(val *byte) Byte

NewMaybeByte creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func (Byte) ForceMapToBool

func (o Byte) ForceMapToBool(fn func(byte) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Byte) ForceMapToComplex128

func (o Byte) ForceMapToComplex128(fn func(byte) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Byte) ForceMapToComplex64

func (o Byte) ForceMapToComplex64(fn func(byte) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Byte) ForceMapToFloat32

func (o Byte) ForceMapToFloat32(fn func(byte) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Byte) ForceMapToFloat64

func (o Byte) ForceMapToFloat64(fn func(byte) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Byte) ForceMapToInt

func (o Byte) ForceMapToInt(fn func(byte) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Byte) ForceMapToInt16

func (o Byte) ForceMapToInt16(fn func(byte) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Byte) ForceMapToInt32

func (o Byte) ForceMapToInt32(fn func(byte) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Byte) ForceMapToInt64

func (o Byte) ForceMapToInt64(fn func(byte) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Byte) ForceMapToInt8

func (o Byte) ForceMapToInt8(fn func(byte) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Byte) ForceMapToRune

func (o Byte) ForceMapToRune(fn func(byte) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Byte) ForceMapToString

func (o Byte) ForceMapToString(fn func(byte) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Byte) ForceMapToUint

func (o Byte) ForceMapToUint(fn func(byte) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Byte) ForceMapToUint16

func (o Byte) ForceMapToUint16(fn func(byte) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Byte) ForceMapToUint32

func (o Byte) ForceMapToUint32(fn func(byte) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Byte) ForceMapToUint64

func (o Byte) ForceMapToUint64(fn func(byte) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Byte) ForceMapToUint8

func (o Byte) ForceMapToUint8(fn func(byte) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Byte) ForceMapToUntyped

func (o Byte) ForceMapToUntyped(fn func(byte) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Byte) Get

func (o Byte) Get() byte

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Byte) IsNil

func (o Byte) IsNil() bool

IsNil returns whether or not this option is empty.

func (Byte) IsPresent

func (o Byte) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Byte) MapToBool

func (o Byte) MapToBool(fn func(byte) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Byte) MapToComplex128

func (o Byte) MapToComplex128(fn func(byte) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Byte) MapToComplex64

func (o Byte) MapToComplex64(fn func(byte) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Byte) MapToFloat32

func (o Byte) MapToFloat32(fn func(byte) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Byte) MapToFloat64

func (o Byte) MapToFloat64(fn func(byte) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Byte) MapToInt

func (o Byte) MapToInt(fn func(byte) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Byte) MapToInt16

func (o Byte) MapToInt16(fn func(byte) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Byte) MapToInt32

func (o Byte) MapToInt32(fn func(byte) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Byte) MapToInt64

func (o Byte) MapToInt64(fn func(byte) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Byte) MapToInt8

func (o Byte) MapToInt8(fn func(byte) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Byte) MapToNillable

func (o Byte) MapToNillable(fn func(byte) *byte) Byte

MapToNillable either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Byte) MapToNillableBool

func (o Byte) MapToNillableBool(fn func(byte) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Byte) MapToNillableComplex128

func (o Byte) MapToNillableComplex128(fn func(byte) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableComplex64

func (o Byte) MapToNillableComplex64(fn func(byte) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableFloat32

func (o Byte) MapToNillableFloat32(fn func(byte) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableFloat64

func (o Byte) MapToNillableFloat64(fn func(byte) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableInt

func (o Byte) MapToNillableInt(fn func(byte) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Byte) MapToNillableInt16

func (o Byte) MapToNillableInt16(fn func(byte) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableInt32

func (o Byte) MapToNillableInt32(fn func(byte) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableInt64

func (o Byte) MapToNillableInt64(fn func(byte) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableInt8

func (o Byte) MapToNillableInt8(fn func(byte) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableRune

func (o Byte) MapToNillableRune(fn func(byte) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Byte) MapToNillableString

func (o Byte) MapToNillableString(fn func(byte) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Byte) MapToNillableUint

func (o Byte) MapToNillableUint(fn func(byte) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Byte) MapToNillableUint16

func (o Byte) MapToNillableUint16(fn func(byte) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableUint32

func (o Byte) MapToNillableUint32(fn func(byte) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableUint64

func (o Byte) MapToNillableUint64(fn func(byte) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableUint8

func (o Byte) MapToNillableUint8(fn func(byte) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Byte) MapToNillableUntyped

func (o Byte) MapToNillableUntyped(fn func(byte) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Byte) MapToRune

func (o Byte) MapToRune(fn func(byte) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Byte) MapToString

func (o Byte) MapToString(fn func(byte) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Byte) MapToUint

func (o Byte) MapToUint(fn func(byte) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Byte) MapToUint16

func (o Byte) MapToUint16(fn func(byte) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Byte) MapToUint32

func (o Byte) MapToUint32(fn func(byte) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Byte) MapToUint64

func (o Byte) MapToUint64(fn func(byte) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Byte) MapToUint8

func (o Byte) MapToUint8(fn func(byte) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Byte) MapToUntyped

func (o Byte) MapToUntyped(fn func(byte) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Byte) Or

func (o Byte) Or(def byte) byte

Or returns either the value stored in this option or the given default value.

func (Byte) OrGet

func (o Byte) OrGet(fn func() byte) byte

OrGet returns either the value stored in this option or result of calling the given function.

func (Byte) OrPanicWith

func (o Byte) OrPanicWith(fn func() interface{}) byte

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Byte) OrPanicWithVal

func (o Byte) OrPanicWithVal(err interface{}) byte

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Complex128

type Complex128 struct {
	// contains filtered or unexported fields
}

Complex128 wraps an complex128 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewComplex128

func NewComplex128(val complex128) Complex128

NewComplex128 creates a new complex128 option wrapping the given value.

func NewEmptyComplex128

func NewEmptyComplex128() Complex128

NewEmptyComplex128 creates a new empty complex128 option.

func NewMaybeComplex128

func NewMaybeComplex128(val *complex128) Complex128

NewMaybeComplex128 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func (Complex128) ForceMapToBool

func (o Complex128) ForceMapToBool(fn func(complex128) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Complex128) ForceMapToByte

func (o Complex128) ForceMapToByte(fn func(complex128) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Complex128) ForceMapToComplex64

func (o Complex128) ForceMapToComplex64(fn func(complex128) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Complex128) ForceMapToFloat32

func (o Complex128) ForceMapToFloat32(fn func(complex128) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Complex128) ForceMapToFloat64

func (o Complex128) ForceMapToFloat64(fn func(complex128) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Complex128) ForceMapToInt

func (o Complex128) ForceMapToInt(fn func(complex128) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Complex128) ForceMapToInt16

func (o Complex128) ForceMapToInt16(fn func(complex128) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Complex128) ForceMapToInt32

func (o Complex128) ForceMapToInt32(fn func(complex128) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Complex128) ForceMapToInt64

func (o Complex128) ForceMapToInt64(fn func(complex128) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Complex128) ForceMapToInt8

func (o Complex128) ForceMapToInt8(fn func(complex128) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Complex128) ForceMapToRune

func (o Complex128) ForceMapToRune(fn func(complex128) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Complex128) ForceMapToString

func (o Complex128) ForceMapToString(fn func(complex128) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Complex128) ForceMapToUint

func (o Complex128) ForceMapToUint(fn func(complex128) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Complex128) ForceMapToUint16

func (o Complex128) ForceMapToUint16(fn func(complex128) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Complex128) ForceMapToUint32

func (o Complex128) ForceMapToUint32(fn func(complex128) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Complex128) ForceMapToUint64

func (o Complex128) ForceMapToUint64(fn func(complex128) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Complex128) ForceMapToUint8

func (o Complex128) ForceMapToUint8(fn func(complex128) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Complex128) ForceMapToUntyped

func (o Complex128) ForceMapToUntyped(fn func(complex128) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Complex128) Get

func (o Complex128) Get() complex128

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Complex128) IsNil

func (o Complex128) IsNil() bool

IsNil returns whether or not this option is empty.

func (Complex128) IsPresent

func (o Complex128) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Complex128) MapToBool

func (o Complex128) MapToBool(fn func(complex128) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Complex128) MapToByte

func (o Complex128) MapToByte(fn func(complex128) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Complex128) MapToComplex64

func (o Complex128) MapToComplex64(fn func(complex128) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Complex128) MapToFloat32

func (o Complex128) MapToFloat32(fn func(complex128) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Complex128) MapToFloat64

func (o Complex128) MapToFloat64(fn func(complex128) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Complex128) MapToInt

func (o Complex128) MapToInt(fn func(complex128) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Complex128) MapToInt16

func (o Complex128) MapToInt16(fn func(complex128) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Complex128) MapToInt32

func (o Complex128) MapToInt32(fn func(complex128) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Complex128) MapToInt64

func (o Complex128) MapToInt64(fn func(complex128) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Complex128) MapToInt8

func (o Complex128) MapToInt8(fn func(complex128) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Complex128) MapToNillable

func (o Complex128) MapToNillable(fn func(complex128) *complex128) Complex128

MapToNillable either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableBool

func (o Complex128) MapToNillableBool(fn func(complex128) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableByte

func (o Complex128) MapToNillableByte(fn func(complex128) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableComplex64

func (o Complex128) MapToNillableComplex64(fn func(complex128) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableFloat32

func (o Complex128) MapToNillableFloat32(fn func(complex128) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableFloat64

func (o Complex128) MapToNillableFloat64(fn func(complex128) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableInt

func (o Complex128) MapToNillableInt(fn func(complex128) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableInt16

func (o Complex128) MapToNillableInt16(fn func(complex128) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableInt32

func (o Complex128) MapToNillableInt32(fn func(complex128) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableInt64

func (o Complex128) MapToNillableInt64(fn func(complex128) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableInt8

func (o Complex128) MapToNillableInt8(fn func(complex128) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableRune

func (o Complex128) MapToNillableRune(fn func(complex128) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableString

func (o Complex128) MapToNillableString(fn func(complex128) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableUint

func (o Complex128) MapToNillableUint(fn func(complex128) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableUint16

func (o Complex128) MapToNillableUint16(fn func(complex128) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableUint32

func (o Complex128) MapToNillableUint32(fn func(complex128) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableUint64

func (o Complex128) MapToNillableUint64(fn func(complex128) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableUint8

func (o Complex128) MapToNillableUint8(fn func(complex128) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Complex128) MapToNillableUntyped

func (o Complex128) MapToNillableUntyped(fn func(complex128) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Complex128) MapToRune

func (o Complex128) MapToRune(fn func(complex128) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Complex128) MapToString

func (o Complex128) MapToString(fn func(complex128) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Complex128) MapToUint

func (o Complex128) MapToUint(fn func(complex128) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Complex128) MapToUint16

func (o Complex128) MapToUint16(fn func(complex128) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Complex128) MapToUint32

func (o Complex128) MapToUint32(fn func(complex128) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Complex128) MapToUint64

func (o Complex128) MapToUint64(fn func(complex128) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Complex128) MapToUint8

func (o Complex128) MapToUint8(fn func(complex128) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Complex128) MapToUntyped

func (o Complex128) MapToUntyped(fn func(complex128) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Complex128) Or

func (o Complex128) Or(def complex128) complex128

Or returns either the value stored in this option or the given default value.

func (Complex128) OrGet

func (o Complex128) OrGet(fn func() complex128) complex128

OrGet returns either the value stored in this option or result of calling the given function.

func (Complex128) OrPanicWith

func (o Complex128) OrPanicWith(fn func() interface{}) complex128

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Complex128) OrPanicWithVal

func (o Complex128) OrPanicWithVal(err interface{}) complex128

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Complex64

type Complex64 struct {
	// contains filtered or unexported fields
}

Complex64 wraps an complex64 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewComplex64

func NewComplex64(val complex64) Complex64

NewComplex64 creates a new complex64 option wrapping the given value.

func NewEmptyComplex64

func NewEmptyComplex64() Complex64

NewEmptyComplex64 creates a new empty complex64 option.

func NewMaybeComplex64

func NewMaybeComplex64(val *complex64) Complex64

NewMaybeComplex64 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func (Complex64) ForceMapToBool

func (o Complex64) ForceMapToBool(fn func(complex64) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Complex64) ForceMapToByte

func (o Complex64) ForceMapToByte(fn func(complex64) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Complex64) ForceMapToComplex128

func (o Complex64) ForceMapToComplex128(fn func(complex64) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Complex64) ForceMapToFloat32

func (o Complex64) ForceMapToFloat32(fn func(complex64) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Complex64) ForceMapToFloat64

func (o Complex64) ForceMapToFloat64(fn func(complex64) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Complex64) ForceMapToInt

func (o Complex64) ForceMapToInt(fn func(complex64) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Complex64) ForceMapToInt16

func (o Complex64) ForceMapToInt16(fn func(complex64) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Complex64) ForceMapToInt32

func (o Complex64) ForceMapToInt32(fn func(complex64) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Complex64) ForceMapToInt64

func (o Complex64) ForceMapToInt64(fn func(complex64) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Complex64) ForceMapToInt8

func (o Complex64) ForceMapToInt8(fn func(complex64) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Complex64) ForceMapToRune

func (o Complex64) ForceMapToRune(fn func(complex64) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Complex64) ForceMapToString

func (o Complex64) ForceMapToString(fn func(complex64) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Complex64) ForceMapToUint

func (o Complex64) ForceMapToUint(fn func(complex64) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Complex64) ForceMapToUint16

func (o Complex64) ForceMapToUint16(fn func(complex64) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Complex64) ForceMapToUint32

func (o Complex64) ForceMapToUint32(fn func(complex64) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Complex64) ForceMapToUint64

func (o Complex64) ForceMapToUint64(fn func(complex64) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Complex64) ForceMapToUint8

func (o Complex64) ForceMapToUint8(fn func(complex64) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Complex64) ForceMapToUntyped

func (o Complex64) ForceMapToUntyped(fn func(complex64) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Complex64) Get

func (o Complex64) Get() complex64

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Complex64) IsNil

func (o Complex64) IsNil() bool

IsNil returns whether or not this option is empty.

func (Complex64) IsPresent

func (o Complex64) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Complex64) MapToBool

func (o Complex64) MapToBool(fn func(complex64) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Complex64) MapToByte

func (o Complex64) MapToByte(fn func(complex64) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Complex64) MapToComplex128

func (o Complex64) MapToComplex128(fn func(complex64) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Complex64) MapToFloat32

func (o Complex64) MapToFloat32(fn func(complex64) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Complex64) MapToFloat64

func (o Complex64) MapToFloat64(fn func(complex64) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Complex64) MapToInt

func (o Complex64) MapToInt(fn func(complex64) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Complex64) MapToInt16

func (o Complex64) MapToInt16(fn func(complex64) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Complex64) MapToInt32

func (o Complex64) MapToInt32(fn func(complex64) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Complex64) MapToInt64

func (o Complex64) MapToInt64(fn func(complex64) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Complex64) MapToInt8

func (o Complex64) MapToInt8(fn func(complex64) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Complex64) MapToNillable

func (o Complex64) MapToNillable(fn func(complex64) *complex64) Complex64

MapToNillable either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableBool

func (o Complex64) MapToNillableBool(fn func(complex64) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableByte

func (o Complex64) MapToNillableByte(fn func(complex64) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableComplex128

func (o Complex64) MapToNillableComplex128(fn func(complex64) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableFloat32

func (o Complex64) MapToNillableFloat32(fn func(complex64) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableFloat64

func (o Complex64) MapToNillableFloat64(fn func(complex64) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableInt

func (o Complex64) MapToNillableInt(fn func(complex64) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableInt16

func (o Complex64) MapToNillableInt16(fn func(complex64) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableInt32

func (o Complex64) MapToNillableInt32(fn func(complex64) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableInt64

func (o Complex64) MapToNillableInt64(fn func(complex64) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableInt8

func (o Complex64) MapToNillableInt8(fn func(complex64) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableRune

func (o Complex64) MapToNillableRune(fn func(complex64) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableString

func (o Complex64) MapToNillableString(fn func(complex64) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableUint

func (o Complex64) MapToNillableUint(fn func(complex64) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableUint16

func (o Complex64) MapToNillableUint16(fn func(complex64) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableUint32

func (o Complex64) MapToNillableUint32(fn func(complex64) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableUint64

func (o Complex64) MapToNillableUint64(fn func(complex64) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableUint8

func (o Complex64) MapToNillableUint8(fn func(complex64) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Complex64) MapToNillableUntyped

func (o Complex64) MapToNillableUntyped(fn func(complex64) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Complex64) MapToRune

func (o Complex64) MapToRune(fn func(complex64) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Complex64) MapToString

func (o Complex64) MapToString(fn func(complex64) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Complex64) MapToUint

func (o Complex64) MapToUint(fn func(complex64) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Complex64) MapToUint16

func (o Complex64) MapToUint16(fn func(complex64) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Complex64) MapToUint32

func (o Complex64) MapToUint32(fn func(complex64) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Complex64) MapToUint64

func (o Complex64) MapToUint64(fn func(complex64) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Complex64) MapToUint8

func (o Complex64) MapToUint8(fn func(complex64) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Complex64) MapToUntyped

func (o Complex64) MapToUntyped(fn func(complex64) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Complex64) Or

func (o Complex64) Or(def complex64) complex64

Or returns either the value stored in this option or the given default value.

func (Complex64) OrGet

func (o Complex64) OrGet(fn func() complex64) complex64

OrGet returns either the value stored in this option or result of calling the given function.

func (Complex64) OrPanicWith

func (o Complex64) OrPanicWith(fn func() interface{}) complex64

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Complex64) OrPanicWithVal

func (o Complex64) OrPanicWithVal(err interface{}) complex64

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Float32

type Float32 struct {
	// contains filtered or unexported fields
}

Float32 wraps an float32 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyFloat32

func NewEmptyFloat32() Float32

NewEmptyFloat32 creates a new empty float32 option.

func NewFloat32

func NewFloat32(val float32) Float32

NewFloat32 creates a new float32 option wrapping the given value.

func NewMaybeFloat32

func NewMaybeFloat32(val *float32) Float32

NewMaybeFloat32 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func (Float32) ForceMapToBool

func (o Float32) ForceMapToBool(fn func(float32) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Float32) ForceMapToByte

func (o Float32) ForceMapToByte(fn func(float32) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Float32) ForceMapToComplex128

func (o Float32) ForceMapToComplex128(fn func(float32) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Float32) ForceMapToComplex64

func (o Float32) ForceMapToComplex64(fn func(float32) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Float32) ForceMapToFloat64

func (o Float32) ForceMapToFloat64(fn func(float32) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Float32) ForceMapToInt

func (o Float32) ForceMapToInt(fn func(float32) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Float32) ForceMapToInt16

func (o Float32) ForceMapToInt16(fn func(float32) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Float32) ForceMapToInt32

func (o Float32) ForceMapToInt32(fn func(float32) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Float32) ForceMapToInt64

func (o Float32) ForceMapToInt64(fn func(float32) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Float32) ForceMapToInt8

func (o Float32) ForceMapToInt8(fn func(float32) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Float32) ForceMapToRune

func (o Float32) ForceMapToRune(fn func(float32) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Float32) ForceMapToString

func (o Float32) ForceMapToString(fn func(float32) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Float32) ForceMapToUint

func (o Float32) ForceMapToUint(fn func(float32) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Float32) ForceMapToUint16

func (o Float32) ForceMapToUint16(fn func(float32) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Float32) ForceMapToUint32

func (o Float32) ForceMapToUint32(fn func(float32) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Float32) ForceMapToUint64

func (o Float32) ForceMapToUint64(fn func(float32) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Float32) ForceMapToUint8

func (o Float32) ForceMapToUint8(fn func(float32) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Float32) ForceMapToUntyped

func (o Float32) ForceMapToUntyped(fn func(float32) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Float32) Get

func (o Float32) Get() float32

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Float32) IsNil

func (o Float32) IsNil() bool

IsNil returns whether or not this option is empty.

func (Float32) IsPresent

func (o Float32) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Float32) MapToBool

func (o Float32) MapToBool(fn func(float32) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Float32) MapToByte

func (o Float32) MapToByte(fn func(float32) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Float32) MapToComplex128

func (o Float32) MapToComplex128(fn func(float32) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Float32) MapToComplex64

func (o Float32) MapToComplex64(fn func(float32) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Float32) MapToFloat64

func (o Float32) MapToFloat64(fn func(float32) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Float32) MapToInt

func (o Float32) MapToInt(fn func(float32) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Float32) MapToInt16

func (o Float32) MapToInt16(fn func(float32) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Float32) MapToInt32

func (o Float32) MapToInt32(fn func(float32) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Float32) MapToInt64

func (o Float32) MapToInt64(fn func(float32) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Float32) MapToInt8

func (o Float32) MapToInt8(fn func(float32) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Float32) MapToNillable

func (o Float32) MapToNillable(fn func(float32) *float32) Float32

MapToNillable either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableBool

func (o Float32) MapToNillableBool(fn func(float32) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Float32) MapToNillableByte

func (o Float32) MapToNillableByte(fn func(float32) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Float32) MapToNillableComplex128

func (o Float32) MapToNillableComplex128(fn func(float32) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableComplex64

func (o Float32) MapToNillableComplex64(fn func(float32) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableFloat64

func (o Float32) MapToNillableFloat64(fn func(float32) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableInt

func (o Float32) MapToNillableInt(fn func(float32) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Float32) MapToNillableInt16

func (o Float32) MapToNillableInt16(fn func(float32) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableInt32

func (o Float32) MapToNillableInt32(fn func(float32) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableInt64

func (o Float32) MapToNillableInt64(fn func(float32) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableInt8

func (o Float32) MapToNillableInt8(fn func(float32) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableRune

func (o Float32) MapToNillableRune(fn func(float32) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Float32) MapToNillableString

func (o Float32) MapToNillableString(fn func(float32) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Float32) MapToNillableUint

func (o Float32) MapToNillableUint(fn func(float32) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Float32) MapToNillableUint16

func (o Float32) MapToNillableUint16(fn func(float32) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableUint32

func (o Float32) MapToNillableUint32(fn func(float32) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableUint64

func (o Float32) MapToNillableUint64(fn func(float32) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableUint8

func (o Float32) MapToNillableUint8(fn func(float32) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Float32) MapToNillableUntyped

func (o Float32) MapToNillableUntyped(fn func(float32) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Float32) MapToRune

func (o Float32) MapToRune(fn func(float32) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Float32) MapToString

func (o Float32) MapToString(fn func(float32) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Float32) MapToUint

func (o Float32) MapToUint(fn func(float32) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Float32) MapToUint16

func (o Float32) MapToUint16(fn func(float32) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Float32) MapToUint32

func (o Float32) MapToUint32(fn func(float32) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Float32) MapToUint64

func (o Float32) MapToUint64(fn func(float32) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Float32) MapToUint8

func (o Float32) MapToUint8(fn func(float32) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Float32) MapToUntyped

func (o Float32) MapToUntyped(fn func(float32) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Float32) Or

func (o Float32) Or(def float32) float32

Or returns either the value stored in this option or the given default value.

func (Float32) OrGet

func (o Float32) OrGet(fn func() float32) float32

OrGet returns either the value stored in this option or result of calling the given function.

func (Float32) OrPanicWith

func (o Float32) OrPanicWith(fn func() interface{}) float32

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Float32) OrPanicWithVal

func (o Float32) OrPanicWithVal(err interface{}) float32

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Float64

type Float64 struct {
	// contains filtered or unexported fields
}

Float64 wraps an float64 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyFloat64

func NewEmptyFloat64() Float64

NewEmptyFloat64 creates a new empty float64 option.

func NewFloat64

func NewFloat64(val float64) Float64

NewFloat64 creates a new float64 option wrapping the given value.

func NewMaybeFloat64

func NewMaybeFloat64(val *float64) Float64

NewMaybeFloat64 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func (Float64) ForceMapToBool

func (o Float64) ForceMapToBool(fn func(float64) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Float64) ForceMapToByte

func (o Float64) ForceMapToByte(fn func(float64) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Float64) ForceMapToComplex128

func (o Float64) ForceMapToComplex128(fn func(float64) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Float64) ForceMapToComplex64

func (o Float64) ForceMapToComplex64(fn func(float64) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Float64) ForceMapToFloat32

func (o Float64) ForceMapToFloat32(fn func(float64) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Float64) ForceMapToInt

func (o Float64) ForceMapToInt(fn func(float64) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Float64) ForceMapToInt16

func (o Float64) ForceMapToInt16(fn func(float64) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Float64) ForceMapToInt32

func (o Float64) ForceMapToInt32(fn func(float64) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Float64) ForceMapToInt64

func (o Float64) ForceMapToInt64(fn func(float64) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Float64) ForceMapToInt8

func (o Float64) ForceMapToInt8(fn func(float64) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Float64) ForceMapToRune

func (o Float64) ForceMapToRune(fn func(float64) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Float64) ForceMapToString

func (o Float64) ForceMapToString(fn func(float64) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Float64) ForceMapToUint

func (o Float64) ForceMapToUint(fn func(float64) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Float64) ForceMapToUint16

func (o Float64) ForceMapToUint16(fn func(float64) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Float64) ForceMapToUint32

func (o Float64) ForceMapToUint32(fn func(float64) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Float64) ForceMapToUint64

func (o Float64) ForceMapToUint64(fn func(float64) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Float64) ForceMapToUint8

func (o Float64) ForceMapToUint8(fn func(float64) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Float64) ForceMapToUntyped

func (o Float64) ForceMapToUntyped(fn func(float64) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Float64) Get

func (o Float64) Get() float64

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Float64) IsNil

func (o Float64) IsNil() bool

IsNil returns whether or not this option is empty.

func (Float64) IsPresent

func (o Float64) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Float64) MapToBool

func (o Float64) MapToBool(fn func(float64) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Float64) MapToByte

func (o Float64) MapToByte(fn func(float64) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Float64) MapToComplex128

func (o Float64) MapToComplex128(fn func(float64) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Float64) MapToComplex64

func (o Float64) MapToComplex64(fn func(float64) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Float64) MapToFloat32

func (o Float64) MapToFloat32(fn func(float64) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Float64) MapToInt

func (o Float64) MapToInt(fn func(float64) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Float64) MapToInt16

func (o Float64) MapToInt16(fn func(float64) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Float64) MapToInt32

func (o Float64) MapToInt32(fn func(float64) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Float64) MapToInt64

func (o Float64) MapToInt64(fn func(float64) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Float64) MapToInt8

func (o Float64) MapToInt8(fn func(float64) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Float64) MapToNillable

func (o Float64) MapToNillable(fn func(float64) *float64) Float64

MapToNillable either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableBool

func (o Float64) MapToNillableBool(fn func(float64) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Float64) MapToNillableByte

func (o Float64) MapToNillableByte(fn func(float64) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Float64) MapToNillableComplex128

func (o Float64) MapToNillableComplex128(fn func(float64) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableComplex64

func (o Float64) MapToNillableComplex64(fn func(float64) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableFloat32

func (o Float64) MapToNillableFloat32(fn func(float64) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableInt

func (o Float64) MapToNillableInt(fn func(float64) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Float64) MapToNillableInt16

func (o Float64) MapToNillableInt16(fn func(float64) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableInt32

func (o Float64) MapToNillableInt32(fn func(float64) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableInt64

func (o Float64) MapToNillableInt64(fn func(float64) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableInt8

func (o Float64) MapToNillableInt8(fn func(float64) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableRune

func (o Float64) MapToNillableRune(fn func(float64) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Float64) MapToNillableString

func (o Float64) MapToNillableString(fn func(float64) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Float64) MapToNillableUint

func (o Float64) MapToNillableUint(fn func(float64) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Float64) MapToNillableUint16

func (o Float64) MapToNillableUint16(fn func(float64) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableUint32

func (o Float64) MapToNillableUint32(fn func(float64) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableUint64

func (o Float64) MapToNillableUint64(fn func(float64) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableUint8

func (o Float64) MapToNillableUint8(fn func(float64) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Float64) MapToNillableUntyped

func (o Float64) MapToNillableUntyped(fn func(float64) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Float64) MapToRune

func (o Float64) MapToRune(fn func(float64) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Float64) MapToString

func (o Float64) MapToString(fn func(float64) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Float64) MapToUint

func (o Float64) MapToUint(fn func(float64) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Float64) MapToUint16

func (o Float64) MapToUint16(fn func(float64) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Float64) MapToUint32

func (o Float64) MapToUint32(fn func(float64) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Float64) MapToUint64

func (o Float64) MapToUint64(fn func(float64) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Float64) MapToUint8

func (o Float64) MapToUint8(fn func(float64) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Float64) MapToUntyped

func (o Float64) MapToUntyped(fn func(float64) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Float64) Or

func (o Float64) Or(def float64) float64

Or returns either the value stored in this option or the given default value.

func (Float64) OrGet

func (o Float64) OrGet(fn func() float64) float64

OrGet returns either the value stored in this option or result of calling the given function.

func (Float64) OrPanicWith

func (o Float64) OrPanicWith(fn func() interface{}) float64

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Float64) OrPanicWithVal

func (o Float64) OrPanicWithVal(err interface{}) float64

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Int

type Int struct {
	// contains filtered or unexported fields
}

Int wraps an int value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyInt

func NewEmptyInt() Int

NewEmptyInt creates a new empty int option.

func NewInt

func NewInt(val int) Int

NewInt creates a new int option wrapping the given value.

func NewMaybeInt

func NewMaybeInt(val *int) Int

NewMaybeInt creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func (Int) ForceMapToBool

func (o Int) ForceMapToBool(fn func(int) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Int) ForceMapToByte

func (o Int) ForceMapToByte(fn func(int) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Int) ForceMapToComplex128

func (o Int) ForceMapToComplex128(fn func(int) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Int) ForceMapToComplex64

func (o Int) ForceMapToComplex64(fn func(int) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Int) ForceMapToFloat32

func (o Int) ForceMapToFloat32(fn func(int) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Int) ForceMapToFloat64

func (o Int) ForceMapToFloat64(fn func(int) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Int) ForceMapToInt16

func (o Int) ForceMapToInt16(fn func(int) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Int) ForceMapToInt32

func (o Int) ForceMapToInt32(fn func(int) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Int) ForceMapToInt64

func (o Int) ForceMapToInt64(fn func(int) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Int) ForceMapToInt8

func (o Int) ForceMapToInt8(fn func(int) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Int) ForceMapToRune

func (o Int) ForceMapToRune(fn func(int) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Int) ForceMapToString

func (o Int) ForceMapToString(fn func(int) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Int) ForceMapToUint

func (o Int) ForceMapToUint(fn func(int) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Int) ForceMapToUint16

func (o Int) ForceMapToUint16(fn func(int) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Int) ForceMapToUint32

func (o Int) ForceMapToUint32(fn func(int) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Int) ForceMapToUint64

func (o Int) ForceMapToUint64(fn func(int) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Int) ForceMapToUint8

func (o Int) ForceMapToUint8(fn func(int) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Int) ForceMapToUntyped

func (o Int) ForceMapToUntyped(fn func(int) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Int) Get

func (o Int) Get() int

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Int) IsNil

func (o Int) IsNil() bool

IsNil returns whether or not this option is empty.

func (Int) IsPresent

func (o Int) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Int) MapToBool

func (o Int) MapToBool(fn func(int) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Int) MapToByte

func (o Int) MapToByte(fn func(int) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Int) MapToComplex128

func (o Int) MapToComplex128(fn func(int) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Int) MapToComplex64

func (o Int) MapToComplex64(fn func(int) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Int) MapToFloat32

func (o Int) MapToFloat32(fn func(int) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Int) MapToFloat64

func (o Int) MapToFloat64(fn func(int) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Int) MapToInt16

func (o Int) MapToInt16(fn func(int) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Int) MapToInt32

func (o Int) MapToInt32(fn func(int) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Int) MapToInt64

func (o Int) MapToInt64(fn func(int) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Int) MapToInt8

func (o Int) MapToInt8(fn func(int) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Int) MapToNillable

func (o Int) MapToNillable(fn func(int) *int) Int

MapToNillable either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Int) MapToNillableBool

func (o Int) MapToNillableBool(fn func(int) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Int) MapToNillableByte

func (o Int) MapToNillableByte(fn func(int) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Int) MapToNillableComplex128

func (o Int) MapToNillableComplex128(fn func(int) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Int) MapToNillableComplex64

func (o Int) MapToNillableComplex64(fn func(int) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Int) MapToNillableFloat32

func (o Int) MapToNillableFloat32(fn func(int) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Int) MapToNillableFloat64

func (o Int) MapToNillableFloat64(fn func(int) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Int) MapToNillableInt16

func (o Int) MapToNillableInt16(fn func(int) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Int) MapToNillableInt32

func (o Int) MapToNillableInt32(fn func(int) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Int) MapToNillableInt64

func (o Int) MapToNillableInt64(fn func(int) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Int) MapToNillableInt8

func (o Int) MapToNillableInt8(fn func(int) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Int) MapToNillableRune

func (o Int) MapToNillableRune(fn func(int) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Int) MapToNillableString

func (o Int) MapToNillableString(fn func(int) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Int) MapToNillableUint

func (o Int) MapToNillableUint(fn func(int) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Int) MapToNillableUint16

func (o Int) MapToNillableUint16(fn func(int) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Int) MapToNillableUint32

func (o Int) MapToNillableUint32(fn func(int) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Int) MapToNillableUint64

func (o Int) MapToNillableUint64(fn func(int) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Int) MapToNillableUint8

func (o Int) MapToNillableUint8(fn func(int) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Int) MapToNillableUntyped

func (o Int) MapToNillableUntyped(fn func(int) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Int) MapToRune

func (o Int) MapToRune(fn func(int) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Int) MapToString

func (o Int) MapToString(fn func(int) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Int) MapToUint

func (o Int) MapToUint(fn func(int) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Int) MapToUint16

func (o Int) MapToUint16(fn func(int) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Int) MapToUint32

func (o Int) MapToUint32(fn func(int) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Int) MapToUint64

func (o Int) MapToUint64(fn func(int) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Int) MapToUint8

func (o Int) MapToUint8(fn func(int) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Int) MapToUntyped

func (o Int) MapToUntyped(fn func(int) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Int) Or

func (o Int) Or(def int) int

Or returns either the value stored in this option or the given default value.

func (Int) OrGet

func (o Int) OrGet(fn func() int) int

OrGet returns either the value stored in this option or result of calling the given function.

func (Int) OrPanicWith

func (o Int) OrPanicWith(fn func() interface{}) int

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Int) OrPanicWithVal

func (o Int) OrPanicWithVal(err interface{}) int

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Int16

type Int16 struct {
	// contains filtered or unexported fields
}

Int16 wraps an int16 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyInt16

func NewEmptyInt16() Int16

NewEmptyInt16 creates a new empty int16 option.

func NewInt16

func NewInt16(val int16) Int16

NewInt16 creates a new int16 option wrapping the given value.

func NewMaybeInt16

func NewMaybeInt16(val *int16) Int16

NewMaybeInt16 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func (Int16) ForceMapToBool

func (o Int16) ForceMapToBool(fn func(int16) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Int16) ForceMapToByte

func (o Int16) ForceMapToByte(fn func(int16) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Int16) ForceMapToComplex128

func (o Int16) ForceMapToComplex128(fn func(int16) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Int16) ForceMapToComplex64

func (o Int16) ForceMapToComplex64(fn func(int16) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Int16) ForceMapToFloat32

func (o Int16) ForceMapToFloat32(fn func(int16) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Int16) ForceMapToFloat64

func (o Int16) ForceMapToFloat64(fn func(int16) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Int16) ForceMapToInt

func (o Int16) ForceMapToInt(fn func(int16) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Int16) ForceMapToInt32

func (o Int16) ForceMapToInt32(fn func(int16) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Int16) ForceMapToInt64

func (o Int16) ForceMapToInt64(fn func(int16) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Int16) ForceMapToInt8

func (o Int16) ForceMapToInt8(fn func(int16) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Int16) ForceMapToRune

func (o Int16) ForceMapToRune(fn func(int16) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Int16) ForceMapToString

func (o Int16) ForceMapToString(fn func(int16) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Int16) ForceMapToUint

func (o Int16) ForceMapToUint(fn func(int16) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Int16) ForceMapToUint16

func (o Int16) ForceMapToUint16(fn func(int16) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Int16) ForceMapToUint32

func (o Int16) ForceMapToUint32(fn func(int16) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Int16) ForceMapToUint64

func (o Int16) ForceMapToUint64(fn func(int16) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Int16) ForceMapToUint8

func (o Int16) ForceMapToUint8(fn func(int16) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Int16) ForceMapToUntyped

func (o Int16) ForceMapToUntyped(fn func(int16) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Int16) Get

func (o Int16) Get() int16

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Int16) IsNil

func (o Int16) IsNil() bool

IsNil returns whether or not this option is empty.

func (Int16) IsPresent

func (o Int16) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Int16) MapToBool

func (o Int16) MapToBool(fn func(int16) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Int16) MapToByte

func (o Int16) MapToByte(fn func(int16) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Int16) MapToComplex128

func (o Int16) MapToComplex128(fn func(int16) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Int16) MapToComplex64

func (o Int16) MapToComplex64(fn func(int16) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Int16) MapToFloat32

func (o Int16) MapToFloat32(fn func(int16) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Int16) MapToFloat64

func (o Int16) MapToFloat64(fn func(int16) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Int16) MapToInt

func (o Int16) MapToInt(fn func(int16) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Int16) MapToInt32

func (o Int16) MapToInt32(fn func(int16) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Int16) MapToInt64

func (o Int16) MapToInt64(fn func(int16) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Int16) MapToInt8

func (o Int16) MapToInt8(fn func(int16) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Int16) MapToNillable

func (o Int16) MapToNillable(fn func(int16) *int16) Int16

MapToNillable either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableBool

func (o Int16) MapToNillableBool(fn func(int16) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Int16) MapToNillableByte

func (o Int16) MapToNillableByte(fn func(int16) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Int16) MapToNillableComplex128

func (o Int16) MapToNillableComplex128(fn func(int16) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableComplex64

func (o Int16) MapToNillableComplex64(fn func(int16) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableFloat32

func (o Int16) MapToNillableFloat32(fn func(int16) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableFloat64

func (o Int16) MapToNillableFloat64(fn func(int16) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableInt

func (o Int16) MapToNillableInt(fn func(int16) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Int16) MapToNillableInt32

func (o Int16) MapToNillableInt32(fn func(int16) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableInt64

func (o Int16) MapToNillableInt64(fn func(int16) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableInt8

func (o Int16) MapToNillableInt8(fn func(int16) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableRune

func (o Int16) MapToNillableRune(fn func(int16) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Int16) MapToNillableString

func (o Int16) MapToNillableString(fn func(int16) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Int16) MapToNillableUint

func (o Int16) MapToNillableUint(fn func(int16) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Int16) MapToNillableUint16

func (o Int16) MapToNillableUint16(fn func(int16) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableUint32

func (o Int16) MapToNillableUint32(fn func(int16) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableUint64

func (o Int16) MapToNillableUint64(fn func(int16) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableUint8

func (o Int16) MapToNillableUint8(fn func(int16) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Int16) MapToNillableUntyped

func (o Int16) MapToNillableUntyped(fn func(int16) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Int16) MapToRune

func (o Int16) MapToRune(fn func(int16) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Int16) MapToString

func (o Int16) MapToString(fn func(int16) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Int16) MapToUint

func (o Int16) MapToUint(fn func(int16) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Int16) MapToUint16

func (o Int16) MapToUint16(fn func(int16) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Int16) MapToUint32

func (o Int16) MapToUint32(fn func(int16) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Int16) MapToUint64

func (o Int16) MapToUint64(fn func(int16) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Int16) MapToUint8

func (o Int16) MapToUint8(fn func(int16) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Int16) MapToUntyped

func (o Int16) MapToUntyped(fn func(int16) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Int16) Or

func (o Int16) Or(def int16) int16

Or returns either the value stored in this option or the given default value.

func (Int16) OrGet

func (o Int16) OrGet(fn func() int16) int16

OrGet returns either the value stored in this option or result of calling the given function.

func (Int16) OrPanicWith

func (o Int16) OrPanicWith(fn func() interface{}) int16

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Int16) OrPanicWithVal

func (o Int16) OrPanicWithVal(err interface{}) int16

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Int32

type Int32 struct {
	// contains filtered or unexported fields
}

Int32 wraps an int32 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyInt32

func NewEmptyInt32() Int32

NewEmptyInt32 creates a new empty int32 option.

func NewInt32

func NewInt32(val int32) Int32

NewInt32 creates a new int32 option wrapping the given value.

func NewMaybeInt32

func NewMaybeInt32(val *int32) Int32

NewMaybeInt32 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func (Int32) ForceMapToBool

func (o Int32) ForceMapToBool(fn func(int32) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Int32) ForceMapToByte

func (o Int32) ForceMapToByte(fn func(int32) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Int32) ForceMapToComplex128

func (o Int32) ForceMapToComplex128(fn func(int32) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Int32) ForceMapToComplex64

func (o Int32) ForceMapToComplex64(fn func(int32) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Int32) ForceMapToFloat32

func (o Int32) ForceMapToFloat32(fn func(int32) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Int32) ForceMapToFloat64

func (o Int32) ForceMapToFloat64(fn func(int32) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Int32) ForceMapToInt

func (o Int32) ForceMapToInt(fn func(int32) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Int32) ForceMapToInt16

func (o Int32) ForceMapToInt16(fn func(int32) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Int32) ForceMapToInt64

func (o Int32) ForceMapToInt64(fn func(int32) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Int32) ForceMapToInt8

func (o Int32) ForceMapToInt8(fn func(int32) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Int32) ForceMapToRune

func (o Int32) ForceMapToRune(fn func(int32) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Int32) ForceMapToString

func (o Int32) ForceMapToString(fn func(int32) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Int32) ForceMapToUint

func (o Int32) ForceMapToUint(fn func(int32) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Int32) ForceMapToUint16

func (o Int32) ForceMapToUint16(fn func(int32) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Int32) ForceMapToUint32

func (o Int32) ForceMapToUint32(fn func(int32) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Int32) ForceMapToUint64

func (o Int32) ForceMapToUint64(fn func(int32) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Int32) ForceMapToUint8

func (o Int32) ForceMapToUint8(fn func(int32) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Int32) ForceMapToUntyped

func (o Int32) ForceMapToUntyped(fn func(int32) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Int32) Get

func (o Int32) Get() int32

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Int32) IsNil

func (o Int32) IsNil() bool

IsNil returns whether or not this option is empty.

func (Int32) IsPresent

func (o Int32) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Int32) MapToBool

func (o Int32) MapToBool(fn func(int32) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Int32) MapToByte

func (o Int32) MapToByte(fn func(int32) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Int32) MapToComplex128

func (o Int32) MapToComplex128(fn func(int32) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Int32) MapToComplex64

func (o Int32) MapToComplex64(fn func(int32) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Int32) MapToFloat32

func (o Int32) MapToFloat32(fn func(int32) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Int32) MapToFloat64

func (o Int32) MapToFloat64(fn func(int32) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Int32) MapToInt

func (o Int32) MapToInt(fn func(int32) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Int32) MapToInt16

func (o Int32) MapToInt16(fn func(int32) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Int32) MapToInt64

func (o Int32) MapToInt64(fn func(int32) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Int32) MapToInt8

func (o Int32) MapToInt8(fn func(int32) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Int32) MapToNillable

func (o Int32) MapToNillable(fn func(int32) *int32) Int32

MapToNillable either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableBool

func (o Int32) MapToNillableBool(fn func(int32) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Int32) MapToNillableByte

func (o Int32) MapToNillableByte(fn func(int32) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Int32) MapToNillableComplex128

func (o Int32) MapToNillableComplex128(fn func(int32) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableComplex64

func (o Int32) MapToNillableComplex64(fn func(int32) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableFloat32

func (o Int32) MapToNillableFloat32(fn func(int32) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableFloat64

func (o Int32) MapToNillableFloat64(fn func(int32) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableInt

func (o Int32) MapToNillableInt(fn func(int32) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Int32) MapToNillableInt16

func (o Int32) MapToNillableInt16(fn func(int32) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableInt64

func (o Int32) MapToNillableInt64(fn func(int32) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableInt8

func (o Int32) MapToNillableInt8(fn func(int32) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableRune

func (o Int32) MapToNillableRune(fn func(int32) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Int32) MapToNillableString

func (o Int32) MapToNillableString(fn func(int32) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Int32) MapToNillableUint

func (o Int32) MapToNillableUint(fn func(int32) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Int32) MapToNillableUint16

func (o Int32) MapToNillableUint16(fn func(int32) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableUint32

func (o Int32) MapToNillableUint32(fn func(int32) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableUint64

func (o Int32) MapToNillableUint64(fn func(int32) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableUint8

func (o Int32) MapToNillableUint8(fn func(int32) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Int32) MapToNillableUntyped

func (o Int32) MapToNillableUntyped(fn func(int32) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Int32) MapToRune

func (o Int32) MapToRune(fn func(int32) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Int32) MapToString

func (o Int32) MapToString(fn func(int32) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Int32) MapToUint

func (o Int32) MapToUint(fn func(int32) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Int32) MapToUint16

func (o Int32) MapToUint16(fn func(int32) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Int32) MapToUint32

func (o Int32) MapToUint32(fn func(int32) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Int32) MapToUint64

func (o Int32) MapToUint64(fn func(int32) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Int32) MapToUint8

func (o Int32) MapToUint8(fn func(int32) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Int32) MapToUntyped

func (o Int32) MapToUntyped(fn func(int32) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Int32) Or

func (o Int32) Or(def int32) int32

Or returns either the value stored in this option or the given default value.

func (Int32) OrGet

func (o Int32) OrGet(fn func() int32) int32

OrGet returns either the value stored in this option or result of calling the given function.

func (Int32) OrPanicWith

func (o Int32) OrPanicWith(fn func() interface{}) int32

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Int32) OrPanicWithVal

func (o Int32) OrPanicWithVal(err interface{}) int32

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Int64

type Int64 struct {
	// contains filtered or unexported fields
}

Int64 wraps an int64 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyInt64

func NewEmptyInt64() Int64

NewEmptyInt64 creates a new empty int64 option.

func NewInt64

func NewInt64(val int64) Int64

NewInt64 creates a new int64 option wrapping the given value.

func NewMaybeInt64

func NewMaybeInt64(val *int64) Int64

NewMaybeInt64 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func (Int64) ForceMapToBool

func (o Int64) ForceMapToBool(fn func(int64) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Int64) ForceMapToByte

func (o Int64) ForceMapToByte(fn func(int64) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Int64) ForceMapToComplex128

func (o Int64) ForceMapToComplex128(fn func(int64) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Int64) ForceMapToComplex64

func (o Int64) ForceMapToComplex64(fn func(int64) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Int64) ForceMapToFloat32

func (o Int64) ForceMapToFloat32(fn func(int64) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Int64) ForceMapToFloat64

func (o Int64) ForceMapToFloat64(fn func(int64) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Int64) ForceMapToInt

func (o Int64) ForceMapToInt(fn func(int64) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Int64) ForceMapToInt16

func (o Int64) ForceMapToInt16(fn func(int64) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Int64) ForceMapToInt32

func (o Int64) ForceMapToInt32(fn func(int64) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Int64) ForceMapToInt8

func (o Int64) ForceMapToInt8(fn func(int64) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Int64) ForceMapToRune

func (o Int64) ForceMapToRune(fn func(int64) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Int64) ForceMapToString

func (o Int64) ForceMapToString(fn func(int64) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Int64) ForceMapToUint

func (o Int64) ForceMapToUint(fn func(int64) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Int64) ForceMapToUint16

func (o Int64) ForceMapToUint16(fn func(int64) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Int64) ForceMapToUint32

func (o Int64) ForceMapToUint32(fn func(int64) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Int64) ForceMapToUint64

func (o Int64) ForceMapToUint64(fn func(int64) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Int64) ForceMapToUint8

func (o Int64) ForceMapToUint8(fn func(int64) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Int64) ForceMapToUntyped

func (o Int64) ForceMapToUntyped(fn func(int64) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Int64) Get

func (o Int64) Get() int64

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Int64) IsNil

func (o Int64) IsNil() bool

IsNil returns whether or not this option is empty.

func (Int64) IsPresent

func (o Int64) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Int64) MapToBool

func (o Int64) MapToBool(fn func(int64) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Int64) MapToByte

func (o Int64) MapToByte(fn func(int64) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Int64) MapToComplex128

func (o Int64) MapToComplex128(fn func(int64) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Int64) MapToComplex64

func (o Int64) MapToComplex64(fn func(int64) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Int64) MapToFloat32

func (o Int64) MapToFloat32(fn func(int64) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Int64) MapToFloat64

func (o Int64) MapToFloat64(fn func(int64) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Int64) MapToInt

func (o Int64) MapToInt(fn func(int64) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Int64) MapToInt16

func (o Int64) MapToInt16(fn func(int64) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Int64) MapToInt32

func (o Int64) MapToInt32(fn func(int64) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Int64) MapToInt8

func (o Int64) MapToInt8(fn func(int64) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Int64) MapToNillable

func (o Int64) MapToNillable(fn func(int64) *int64) Int64

MapToNillable either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableBool

func (o Int64) MapToNillableBool(fn func(int64) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Int64) MapToNillableByte

func (o Int64) MapToNillableByte(fn func(int64) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Int64) MapToNillableComplex128

func (o Int64) MapToNillableComplex128(fn func(int64) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableComplex64

func (o Int64) MapToNillableComplex64(fn func(int64) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableFloat32

func (o Int64) MapToNillableFloat32(fn func(int64) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableFloat64

func (o Int64) MapToNillableFloat64(fn func(int64) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableInt

func (o Int64) MapToNillableInt(fn func(int64) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Int64) MapToNillableInt16

func (o Int64) MapToNillableInt16(fn func(int64) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableInt32

func (o Int64) MapToNillableInt32(fn func(int64) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableInt8

func (o Int64) MapToNillableInt8(fn func(int64) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableRune

func (o Int64) MapToNillableRune(fn func(int64) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Int64) MapToNillableString

func (o Int64) MapToNillableString(fn func(int64) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Int64) MapToNillableUint

func (o Int64) MapToNillableUint(fn func(int64) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Int64) MapToNillableUint16

func (o Int64) MapToNillableUint16(fn func(int64) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableUint32

func (o Int64) MapToNillableUint32(fn func(int64) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableUint64

func (o Int64) MapToNillableUint64(fn func(int64) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableUint8

func (o Int64) MapToNillableUint8(fn func(int64) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Int64) MapToNillableUntyped

func (o Int64) MapToNillableUntyped(fn func(int64) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Int64) MapToRune

func (o Int64) MapToRune(fn func(int64) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Int64) MapToString

func (o Int64) MapToString(fn func(int64) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Int64) MapToUint

func (o Int64) MapToUint(fn func(int64) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Int64) MapToUint16

func (o Int64) MapToUint16(fn func(int64) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Int64) MapToUint32

func (o Int64) MapToUint32(fn func(int64) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Int64) MapToUint64

func (o Int64) MapToUint64(fn func(int64) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Int64) MapToUint8

func (o Int64) MapToUint8(fn func(int64) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Int64) MapToUntyped

func (o Int64) MapToUntyped(fn func(int64) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Int64) Or

func (o Int64) Or(def int64) int64

Or returns either the value stored in this option or the given default value.

func (Int64) OrGet

func (o Int64) OrGet(fn func() int64) int64

OrGet returns either the value stored in this option or result of calling the given function.

func (Int64) OrPanicWith

func (o Int64) OrPanicWith(fn func() interface{}) int64

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Int64) OrPanicWithVal

func (o Int64) OrPanicWithVal(err interface{}) int64

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Int8

type Int8 struct {
	// contains filtered or unexported fields
}

Int8 wraps an int8 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyInt8

func NewEmptyInt8() Int8

NewEmptyInt8 creates a new empty int8 option.

func NewInt8

func NewInt8(val int8) Int8

NewInt8 creates a new int8 option wrapping the given value.

func NewMaybeInt8

func NewMaybeInt8(val *int8) Int8

NewMaybeInt8 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func (Int8) ForceMapToBool

func (o Int8) ForceMapToBool(fn func(int8) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Int8) ForceMapToByte

func (o Int8) ForceMapToByte(fn func(int8) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Int8) ForceMapToComplex128

func (o Int8) ForceMapToComplex128(fn func(int8) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Int8) ForceMapToComplex64

func (o Int8) ForceMapToComplex64(fn func(int8) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Int8) ForceMapToFloat32

func (o Int8) ForceMapToFloat32(fn func(int8) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Int8) ForceMapToFloat64

func (o Int8) ForceMapToFloat64(fn func(int8) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Int8) ForceMapToInt

func (o Int8) ForceMapToInt(fn func(int8) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Int8) ForceMapToInt16

func (o Int8) ForceMapToInt16(fn func(int8) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Int8) ForceMapToInt32

func (o Int8) ForceMapToInt32(fn func(int8) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Int8) ForceMapToInt64

func (o Int8) ForceMapToInt64(fn func(int8) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Int8) ForceMapToRune

func (o Int8) ForceMapToRune(fn func(int8) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Int8) ForceMapToString

func (o Int8) ForceMapToString(fn func(int8) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Int8) ForceMapToUint

func (o Int8) ForceMapToUint(fn func(int8) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Int8) ForceMapToUint16

func (o Int8) ForceMapToUint16(fn func(int8) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Int8) ForceMapToUint32

func (o Int8) ForceMapToUint32(fn func(int8) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Int8) ForceMapToUint64

func (o Int8) ForceMapToUint64(fn func(int8) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Int8) ForceMapToUint8

func (o Int8) ForceMapToUint8(fn func(int8) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Int8) ForceMapToUntyped

func (o Int8) ForceMapToUntyped(fn func(int8) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Int8) Get

func (o Int8) Get() int8

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Int8) IsNil

func (o Int8) IsNil() bool

IsNil returns whether or not this option is empty.

func (Int8) IsPresent

func (o Int8) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Int8) MapToBool

func (o Int8) MapToBool(fn func(int8) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Int8) MapToByte

func (o Int8) MapToByte(fn func(int8) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Int8) MapToComplex128

func (o Int8) MapToComplex128(fn func(int8) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Int8) MapToComplex64

func (o Int8) MapToComplex64(fn func(int8) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Int8) MapToFloat32

func (o Int8) MapToFloat32(fn func(int8) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Int8) MapToFloat64

func (o Int8) MapToFloat64(fn func(int8) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Int8) MapToInt

func (o Int8) MapToInt(fn func(int8) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Int8) MapToInt16

func (o Int8) MapToInt16(fn func(int8) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Int8) MapToInt32

func (o Int8) MapToInt32(fn func(int8) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Int8) MapToInt64

func (o Int8) MapToInt64(fn func(int8) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Int8) MapToNillable

func (o Int8) MapToNillable(fn func(int8) *int8) Int8

MapToNillable either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableBool

func (o Int8) MapToNillableBool(fn func(int8) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Int8) MapToNillableByte

func (o Int8) MapToNillableByte(fn func(int8) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Int8) MapToNillableComplex128

func (o Int8) MapToNillableComplex128(fn func(int8) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableComplex64

func (o Int8) MapToNillableComplex64(fn func(int8) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableFloat32

func (o Int8) MapToNillableFloat32(fn func(int8) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableFloat64

func (o Int8) MapToNillableFloat64(fn func(int8) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableInt

func (o Int8) MapToNillableInt(fn func(int8) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Int8) MapToNillableInt16

func (o Int8) MapToNillableInt16(fn func(int8) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableInt32

func (o Int8) MapToNillableInt32(fn func(int8) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableInt64

func (o Int8) MapToNillableInt64(fn func(int8) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableRune

func (o Int8) MapToNillableRune(fn func(int8) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Int8) MapToNillableString

func (o Int8) MapToNillableString(fn func(int8) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Int8) MapToNillableUint

func (o Int8) MapToNillableUint(fn func(int8) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Int8) MapToNillableUint16

func (o Int8) MapToNillableUint16(fn func(int8) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableUint32

func (o Int8) MapToNillableUint32(fn func(int8) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableUint64

func (o Int8) MapToNillableUint64(fn func(int8) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableUint8

func (o Int8) MapToNillableUint8(fn func(int8) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Int8) MapToNillableUntyped

func (o Int8) MapToNillableUntyped(fn func(int8) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Int8) MapToRune

func (o Int8) MapToRune(fn func(int8) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Int8) MapToString

func (o Int8) MapToString(fn func(int8) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Int8) MapToUint

func (o Int8) MapToUint(fn func(int8) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Int8) MapToUint16

func (o Int8) MapToUint16(fn func(int8) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Int8) MapToUint32

func (o Int8) MapToUint32(fn func(int8) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Int8) MapToUint64

func (o Int8) MapToUint64(fn func(int8) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Int8) MapToUint8

func (o Int8) MapToUint8(fn func(int8) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Int8) MapToUntyped

func (o Int8) MapToUntyped(fn func(int8) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Int8) Or

func (o Int8) Or(def int8) int8

Or returns either the value stored in this option or the given default value.

func (Int8) OrGet

func (o Int8) OrGet(fn func() int8) int8

OrGet returns either the value stored in this option or result of calling the given function.

func (Int8) OrPanicWith

func (o Int8) OrPanicWith(fn func() interface{}) int8

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Int8) OrPanicWithVal

func (o Int8) OrPanicWithVal(err interface{}) int8

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Rune

type Rune struct {
	// contains filtered or unexported fields
}

Rune wraps an rune value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyRune

func NewEmptyRune() Rune

NewEmptyRune creates a new empty rune option.

func NewMaybeRune

func NewMaybeRune(val *rune) Rune

NewMaybeRune creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func NewRune

func NewRune(val rune) Rune

NewRune creates a new rune option wrapping the given value.

func (Rune) ForceMapToBool

func (o Rune) ForceMapToBool(fn func(rune) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Rune) ForceMapToByte

func (o Rune) ForceMapToByte(fn func(rune) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Rune) ForceMapToComplex128

func (o Rune) ForceMapToComplex128(fn func(rune) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Rune) ForceMapToComplex64

func (o Rune) ForceMapToComplex64(fn func(rune) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Rune) ForceMapToFloat32

func (o Rune) ForceMapToFloat32(fn func(rune) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Rune) ForceMapToFloat64

func (o Rune) ForceMapToFloat64(fn func(rune) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Rune) ForceMapToInt

func (o Rune) ForceMapToInt(fn func(rune) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Rune) ForceMapToInt16

func (o Rune) ForceMapToInt16(fn func(rune) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Rune) ForceMapToInt32

func (o Rune) ForceMapToInt32(fn func(rune) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Rune) ForceMapToInt64

func (o Rune) ForceMapToInt64(fn func(rune) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Rune) ForceMapToInt8

func (o Rune) ForceMapToInt8(fn func(rune) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Rune) ForceMapToString

func (o Rune) ForceMapToString(fn func(rune) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Rune) ForceMapToUint

func (o Rune) ForceMapToUint(fn func(rune) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Rune) ForceMapToUint16

func (o Rune) ForceMapToUint16(fn func(rune) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Rune) ForceMapToUint32

func (o Rune) ForceMapToUint32(fn func(rune) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Rune) ForceMapToUint64

func (o Rune) ForceMapToUint64(fn func(rune) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Rune) ForceMapToUint8

func (o Rune) ForceMapToUint8(fn func(rune) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Rune) ForceMapToUntyped

func (o Rune) ForceMapToUntyped(fn func(rune) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Rune) Get

func (o Rune) Get() rune

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Rune) IsNil

func (o Rune) IsNil() bool

IsNil returns whether or not this option is empty.

func (Rune) IsPresent

func (o Rune) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Rune) MapToBool

func (o Rune) MapToBool(fn func(rune) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Rune) MapToByte

func (o Rune) MapToByte(fn func(rune) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Rune) MapToComplex128

func (o Rune) MapToComplex128(fn func(rune) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Rune) MapToComplex64

func (o Rune) MapToComplex64(fn func(rune) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Rune) MapToFloat32

func (o Rune) MapToFloat32(fn func(rune) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Rune) MapToFloat64

func (o Rune) MapToFloat64(fn func(rune) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Rune) MapToInt

func (o Rune) MapToInt(fn func(rune) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Rune) MapToInt16

func (o Rune) MapToInt16(fn func(rune) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Rune) MapToInt32

func (o Rune) MapToInt32(fn func(rune) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Rune) MapToInt64

func (o Rune) MapToInt64(fn func(rune) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Rune) MapToInt8

func (o Rune) MapToInt8(fn func(rune) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Rune) MapToNillable

func (o Rune) MapToNillable(fn func(rune) *rune) Rune

MapToNillable either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Rune) MapToNillableBool

func (o Rune) MapToNillableBool(fn func(rune) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Rune) MapToNillableByte

func (o Rune) MapToNillableByte(fn func(rune) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Rune) MapToNillableComplex128

func (o Rune) MapToNillableComplex128(fn func(rune) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableComplex64

func (o Rune) MapToNillableComplex64(fn func(rune) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableFloat32

func (o Rune) MapToNillableFloat32(fn func(rune) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableFloat64

func (o Rune) MapToNillableFloat64(fn func(rune) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableInt

func (o Rune) MapToNillableInt(fn func(rune) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Rune) MapToNillableInt16

func (o Rune) MapToNillableInt16(fn func(rune) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableInt32

func (o Rune) MapToNillableInt32(fn func(rune) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableInt64

func (o Rune) MapToNillableInt64(fn func(rune) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableInt8

func (o Rune) MapToNillableInt8(fn func(rune) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableString

func (o Rune) MapToNillableString(fn func(rune) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Rune) MapToNillableUint

func (o Rune) MapToNillableUint(fn func(rune) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Rune) MapToNillableUint16

func (o Rune) MapToNillableUint16(fn func(rune) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableUint32

func (o Rune) MapToNillableUint32(fn func(rune) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableUint64

func (o Rune) MapToNillableUint64(fn func(rune) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableUint8

func (o Rune) MapToNillableUint8(fn func(rune) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Rune) MapToNillableUntyped

func (o Rune) MapToNillableUntyped(fn func(rune) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Rune) MapToString

func (o Rune) MapToString(fn func(rune) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Rune) MapToUint

func (o Rune) MapToUint(fn func(rune) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Rune) MapToUint16

func (o Rune) MapToUint16(fn func(rune) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Rune) MapToUint32

func (o Rune) MapToUint32(fn func(rune) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Rune) MapToUint64

func (o Rune) MapToUint64(fn func(rune) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Rune) MapToUint8

func (o Rune) MapToUint8(fn func(rune) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Rune) MapToUntyped

func (o Rune) MapToUntyped(fn func(rune) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Rune) Or

func (o Rune) Or(def rune) rune

Or returns either the value stored in this option or the given default value.

func (Rune) OrGet

func (o Rune) OrGet(fn func() rune) rune

OrGet returns either the value stored in this option or result of calling the given function.

func (Rune) OrPanicWith

func (o Rune) OrPanicWith(fn func() interface{}) rune

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Rune) OrPanicWithVal

func (o Rune) OrPanicWithVal(err interface{}) rune

OrPanicWithVal returns the value stored in this option or panics with the given value.

type String

type String struct {
	// contains filtered or unexported fields
}

String wraps an string value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyString

func NewEmptyString() String

NewEmptyString creates a new empty string option.

func NewMaybeString

func NewMaybeString(val *string) String

NewMaybeString creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func NewString

func NewString(val string) String

NewString creates a new string option wrapping the given value.

func (String) ForceMapToBool

func (o String) ForceMapToBool(fn func(string) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (String) ForceMapToByte

func (o String) ForceMapToByte(fn func(string) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (String) ForceMapToComplex128

func (o String) ForceMapToComplex128(fn func(string) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (String) ForceMapToComplex64

func (o String) ForceMapToComplex64(fn func(string) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (String) ForceMapToFloat32

func (o String) ForceMapToFloat32(fn func(string) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (String) ForceMapToFloat64

func (o String) ForceMapToFloat64(fn func(string) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (String) ForceMapToInt

func (o String) ForceMapToInt(fn func(string) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (String) ForceMapToInt16

func (o String) ForceMapToInt16(fn func(string) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (String) ForceMapToInt32

func (o String) ForceMapToInt32(fn func(string) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (String) ForceMapToInt64

func (o String) ForceMapToInt64(fn func(string) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (String) ForceMapToInt8

func (o String) ForceMapToInt8(fn func(string) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (String) ForceMapToRune

func (o String) ForceMapToRune(fn func(string) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (String) ForceMapToUint

func (o String) ForceMapToUint(fn func(string) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (String) ForceMapToUint16

func (o String) ForceMapToUint16(fn func(string) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (String) ForceMapToUint32

func (o String) ForceMapToUint32(fn func(string) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (String) ForceMapToUint64

func (o String) ForceMapToUint64(fn func(string) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (String) ForceMapToUint8

func (o String) ForceMapToUint8(fn func(string) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (String) ForceMapToUntyped

func (o String) ForceMapToUntyped(fn func(string) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (String) Get

func (o String) Get() string

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (String) IsNil

func (o String) IsNil() bool

IsNil returns whether or not this option is empty.

func (String) IsPresent

func (o String) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (String) MapToBool

func (o String) MapToBool(fn func(string) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (String) MapToByte

func (o String) MapToByte(fn func(string) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (String) MapToComplex128

func (o String) MapToComplex128(fn func(string) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (String) MapToComplex64

func (o String) MapToComplex64(fn func(string) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (String) MapToFloat32

func (o String) MapToFloat32(fn func(string) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (String) MapToFloat64

func (o String) MapToFloat64(fn func(string) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (String) MapToInt

func (o String) MapToInt(fn func(string) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (String) MapToInt16

func (o String) MapToInt16(fn func(string) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (String) MapToInt32

func (o String) MapToInt32(fn func(string) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (String) MapToInt64

func (o String) MapToInt64(fn func(string) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (String) MapToInt8

func (o String) MapToInt8(fn func(string) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (String) MapToNillable

func (o String) MapToNillable(fn func(string) *string) String

MapToNillable either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (String) MapToNillableBool

func (o String) MapToNillableBool(fn func(string) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (String) MapToNillableByte

func (o String) MapToNillableByte(fn func(string) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (String) MapToNillableComplex128

func (o String) MapToNillableComplex128(fn func(string) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (String) MapToNillableComplex64

func (o String) MapToNillableComplex64(fn func(string) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (String) MapToNillableFloat32

func (o String) MapToNillableFloat32(fn func(string) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (String) MapToNillableFloat64

func (o String) MapToNillableFloat64(fn func(string) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (String) MapToNillableInt

func (o String) MapToNillableInt(fn func(string) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (String) MapToNillableInt16

func (o String) MapToNillableInt16(fn func(string) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (String) MapToNillableInt32

func (o String) MapToNillableInt32(fn func(string) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (String) MapToNillableInt64

func (o String) MapToNillableInt64(fn func(string) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (String) MapToNillableInt8

func (o String) MapToNillableInt8(fn func(string) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (String) MapToNillableRune

func (o String) MapToNillableRune(fn func(string) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (String) MapToNillableUint

func (o String) MapToNillableUint(fn func(string) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (String) MapToNillableUint16

func (o String) MapToNillableUint16(fn func(string) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (String) MapToNillableUint32

func (o String) MapToNillableUint32(fn func(string) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (String) MapToNillableUint64

func (o String) MapToNillableUint64(fn func(string) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (String) MapToNillableUint8

func (o String) MapToNillableUint8(fn func(string) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (String) MapToNillableUntyped

func (o String) MapToNillableUntyped(fn func(string) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (String) MapToRune

func (o String) MapToRune(fn func(string) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (String) MapToUint

func (o String) MapToUint(fn func(string) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (String) MapToUint16

func (o String) MapToUint16(fn func(string) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (String) MapToUint32

func (o String) MapToUint32(fn func(string) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (String) MapToUint64

func (o String) MapToUint64(fn func(string) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (String) MapToUint8

func (o String) MapToUint8(fn func(string) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (String) MapToUntyped

func (o String) MapToUntyped(fn func(string) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (String) Or

func (o String) Or(def string) string

Or returns either the value stored in this option or the given default value.

func (String) OrGet

func (o String) OrGet(fn func() string) string

OrGet returns either the value stored in this option or result of calling the given function.

func (String) OrPanicWith

func (o String) OrPanicWith(fn func() interface{}) string

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (String) OrPanicWithVal

func (o String) OrPanicWithVal(err interface{}) string

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Uint

type Uint struct {
	// contains filtered or unexported fields
}

Uint wraps an uint value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyUint

func NewEmptyUint() Uint

NewEmptyUint creates a new empty uint option.

func NewMaybeUint

func NewMaybeUint(val *uint) Uint

NewMaybeUint creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func NewUint

func NewUint(val uint) Uint

NewUint creates a new uint option wrapping the given value.

func (Uint) ForceMapToBool

func (o Uint) ForceMapToBool(fn func(uint) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Uint) ForceMapToByte

func (o Uint) ForceMapToByte(fn func(uint) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Uint) ForceMapToComplex128

func (o Uint) ForceMapToComplex128(fn func(uint) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Uint) ForceMapToComplex64

func (o Uint) ForceMapToComplex64(fn func(uint) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Uint) ForceMapToFloat32

func (o Uint) ForceMapToFloat32(fn func(uint) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Uint) ForceMapToFloat64

func (o Uint) ForceMapToFloat64(fn func(uint) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Uint) ForceMapToInt

func (o Uint) ForceMapToInt(fn func(uint) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Uint) ForceMapToInt16

func (o Uint) ForceMapToInt16(fn func(uint) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Uint) ForceMapToInt32

func (o Uint) ForceMapToInt32(fn func(uint) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Uint) ForceMapToInt64

func (o Uint) ForceMapToInt64(fn func(uint) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Uint) ForceMapToInt8

func (o Uint) ForceMapToInt8(fn func(uint) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Uint) ForceMapToRune

func (o Uint) ForceMapToRune(fn func(uint) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Uint) ForceMapToString

func (o Uint) ForceMapToString(fn func(uint) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Uint) ForceMapToUint16

func (o Uint) ForceMapToUint16(fn func(uint) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Uint) ForceMapToUint32

func (o Uint) ForceMapToUint32(fn func(uint) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Uint) ForceMapToUint64

func (o Uint) ForceMapToUint64(fn func(uint) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Uint) ForceMapToUint8

func (o Uint) ForceMapToUint8(fn func(uint) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Uint) ForceMapToUntyped

func (o Uint) ForceMapToUntyped(fn func(uint) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Uint) Get

func (o Uint) Get() uint

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Uint) IsNil

func (o Uint) IsNil() bool

IsNil returns whether or not this option is empty.

func (Uint) IsPresent

func (o Uint) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Uint) MapToBool

func (o Uint) MapToBool(fn func(uint) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Uint) MapToByte

func (o Uint) MapToByte(fn func(uint) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Uint) MapToComplex128

func (o Uint) MapToComplex128(fn func(uint) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Uint) MapToComplex64

func (o Uint) MapToComplex64(fn func(uint) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Uint) MapToFloat32

func (o Uint) MapToFloat32(fn func(uint) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Uint) MapToFloat64

func (o Uint) MapToFloat64(fn func(uint) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Uint) MapToInt

func (o Uint) MapToInt(fn func(uint) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Uint) MapToInt16

func (o Uint) MapToInt16(fn func(uint) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Uint) MapToInt32

func (o Uint) MapToInt32(fn func(uint) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Uint) MapToInt64

func (o Uint) MapToInt64(fn func(uint) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Uint) MapToInt8

func (o Uint) MapToInt8(fn func(uint) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Uint) MapToNillable

func (o Uint) MapToNillable(fn func(uint) *uint) Uint

MapToNillable either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Uint) MapToNillableBool

func (o Uint) MapToNillableBool(fn func(uint) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Uint) MapToNillableByte

func (o Uint) MapToNillableByte(fn func(uint) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Uint) MapToNillableComplex128

func (o Uint) MapToNillableComplex128(fn func(uint) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableComplex64

func (o Uint) MapToNillableComplex64(fn func(uint) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableFloat32

func (o Uint) MapToNillableFloat32(fn func(uint) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableFloat64

func (o Uint) MapToNillableFloat64(fn func(uint) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableInt

func (o Uint) MapToNillableInt(fn func(uint) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Uint) MapToNillableInt16

func (o Uint) MapToNillableInt16(fn func(uint) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableInt32

func (o Uint) MapToNillableInt32(fn func(uint) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableInt64

func (o Uint) MapToNillableInt64(fn func(uint) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableInt8

func (o Uint) MapToNillableInt8(fn func(uint) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableRune

func (o Uint) MapToNillableRune(fn func(uint) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Uint) MapToNillableString

func (o Uint) MapToNillableString(fn func(uint) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Uint) MapToNillableUint16

func (o Uint) MapToNillableUint16(fn func(uint) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableUint32

func (o Uint) MapToNillableUint32(fn func(uint) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableUint64

func (o Uint) MapToNillableUint64(fn func(uint) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableUint8

func (o Uint) MapToNillableUint8(fn func(uint) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Uint) MapToNillableUntyped

func (o Uint) MapToNillableUntyped(fn func(uint) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Uint) MapToRune

func (o Uint) MapToRune(fn func(uint) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Uint) MapToString

func (o Uint) MapToString(fn func(uint) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Uint) MapToUint16

func (o Uint) MapToUint16(fn func(uint) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Uint) MapToUint32

func (o Uint) MapToUint32(fn func(uint) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Uint) MapToUint64

func (o Uint) MapToUint64(fn func(uint) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Uint) MapToUint8

func (o Uint) MapToUint8(fn func(uint) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Uint) MapToUntyped

func (o Uint) MapToUntyped(fn func(uint) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Uint) Or

func (o Uint) Or(def uint) uint

Or returns either the value stored in this option or the given default value.

func (Uint) OrGet

func (o Uint) OrGet(fn func() uint) uint

OrGet returns either the value stored in this option or result of calling the given function.

func (Uint) OrPanicWith

func (o Uint) OrPanicWith(fn func() interface{}) uint

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Uint) OrPanicWithVal

func (o Uint) OrPanicWithVal(err interface{}) uint

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Uint16

type Uint16 struct {
	// contains filtered or unexported fields
}

Uint16 wraps an uint16 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyUint16

func NewEmptyUint16() Uint16

NewEmptyUint16 creates a new empty uint16 option.

func NewMaybeUint16

func NewMaybeUint16(val *uint16) Uint16

NewMaybeUint16 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func NewUint16

func NewUint16(val uint16) Uint16

NewUint16 creates a new uint16 option wrapping the given value.

func (Uint16) ForceMapToBool

func (o Uint16) ForceMapToBool(fn func(uint16) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Uint16) ForceMapToByte

func (o Uint16) ForceMapToByte(fn func(uint16) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Uint16) ForceMapToComplex128

func (o Uint16) ForceMapToComplex128(fn func(uint16) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Uint16) ForceMapToComplex64

func (o Uint16) ForceMapToComplex64(fn func(uint16) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Uint16) ForceMapToFloat32

func (o Uint16) ForceMapToFloat32(fn func(uint16) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Uint16) ForceMapToFloat64

func (o Uint16) ForceMapToFloat64(fn func(uint16) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Uint16) ForceMapToInt

func (o Uint16) ForceMapToInt(fn func(uint16) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Uint16) ForceMapToInt16

func (o Uint16) ForceMapToInt16(fn func(uint16) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Uint16) ForceMapToInt32

func (o Uint16) ForceMapToInt32(fn func(uint16) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Uint16) ForceMapToInt64

func (o Uint16) ForceMapToInt64(fn func(uint16) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Uint16) ForceMapToInt8

func (o Uint16) ForceMapToInt8(fn func(uint16) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Uint16) ForceMapToRune

func (o Uint16) ForceMapToRune(fn func(uint16) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Uint16) ForceMapToString

func (o Uint16) ForceMapToString(fn func(uint16) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Uint16) ForceMapToUint

func (o Uint16) ForceMapToUint(fn func(uint16) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Uint16) ForceMapToUint32

func (o Uint16) ForceMapToUint32(fn func(uint16) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Uint16) ForceMapToUint64

func (o Uint16) ForceMapToUint64(fn func(uint16) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Uint16) ForceMapToUint8

func (o Uint16) ForceMapToUint8(fn func(uint16) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Uint16) ForceMapToUntyped

func (o Uint16) ForceMapToUntyped(fn func(uint16) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Uint16) Get

func (o Uint16) Get() uint16

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Uint16) IsNil

func (o Uint16) IsNil() bool

IsNil returns whether or not this option is empty.

func (Uint16) IsPresent

func (o Uint16) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Uint16) MapToBool

func (o Uint16) MapToBool(fn func(uint16) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Uint16) MapToByte

func (o Uint16) MapToByte(fn func(uint16) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Uint16) MapToComplex128

func (o Uint16) MapToComplex128(fn func(uint16) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Uint16) MapToComplex64

func (o Uint16) MapToComplex64(fn func(uint16) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Uint16) MapToFloat32

func (o Uint16) MapToFloat32(fn func(uint16) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Uint16) MapToFloat64

func (o Uint16) MapToFloat64(fn func(uint16) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Uint16) MapToInt

func (o Uint16) MapToInt(fn func(uint16) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Uint16) MapToInt16

func (o Uint16) MapToInt16(fn func(uint16) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Uint16) MapToInt32

func (o Uint16) MapToInt32(fn func(uint16) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Uint16) MapToInt64

func (o Uint16) MapToInt64(fn func(uint16) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Uint16) MapToInt8

func (o Uint16) MapToInt8(fn func(uint16) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Uint16) MapToNillable

func (o Uint16) MapToNillable(fn func(uint16) *uint16) Uint16

MapToNillable either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableBool

func (o Uint16) MapToNillableBool(fn func(uint16) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableByte

func (o Uint16) MapToNillableByte(fn func(uint16) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableComplex128

func (o Uint16) MapToNillableComplex128(fn func(uint16) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableComplex64

func (o Uint16) MapToNillableComplex64(fn func(uint16) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableFloat32

func (o Uint16) MapToNillableFloat32(fn func(uint16) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableFloat64

func (o Uint16) MapToNillableFloat64(fn func(uint16) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableInt

func (o Uint16) MapToNillableInt(fn func(uint16) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableInt16

func (o Uint16) MapToNillableInt16(fn func(uint16) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableInt32

func (o Uint16) MapToNillableInt32(fn func(uint16) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableInt64

func (o Uint16) MapToNillableInt64(fn func(uint16) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableInt8

func (o Uint16) MapToNillableInt8(fn func(uint16) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableRune

func (o Uint16) MapToNillableRune(fn func(uint16) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableString

func (o Uint16) MapToNillableString(fn func(uint16) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableUint

func (o Uint16) MapToNillableUint(fn func(uint16) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableUint32

func (o Uint16) MapToNillableUint32(fn func(uint16) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableUint64

func (o Uint16) MapToNillableUint64(fn func(uint16) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableUint8

func (o Uint16) MapToNillableUint8(fn func(uint16) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Uint16) MapToNillableUntyped

func (o Uint16) MapToNillableUntyped(fn func(uint16) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Uint16) MapToRune

func (o Uint16) MapToRune(fn func(uint16) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Uint16) MapToString

func (o Uint16) MapToString(fn func(uint16) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Uint16) MapToUint

func (o Uint16) MapToUint(fn func(uint16) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Uint16) MapToUint32

func (o Uint16) MapToUint32(fn func(uint16) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Uint16) MapToUint64

func (o Uint16) MapToUint64(fn func(uint16) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Uint16) MapToUint8

func (o Uint16) MapToUint8(fn func(uint16) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Uint16) MapToUntyped

func (o Uint16) MapToUntyped(fn func(uint16) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Uint16) Or

func (o Uint16) Or(def uint16) uint16

Or returns either the value stored in this option or the given default value.

func (Uint16) OrGet

func (o Uint16) OrGet(fn func() uint16) uint16

OrGet returns either the value stored in this option or result of calling the given function.

func (Uint16) OrPanicWith

func (o Uint16) OrPanicWith(fn func() interface{}) uint16

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Uint16) OrPanicWithVal

func (o Uint16) OrPanicWithVal(err interface{}) uint16

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Uint32

type Uint32 struct {
	// contains filtered or unexported fields
}

Uint32 wraps an uint32 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyUint32

func NewEmptyUint32() Uint32

NewEmptyUint32 creates a new empty uint32 option.

func NewMaybeUint32

func NewMaybeUint32(val *uint32) Uint32

NewMaybeUint32 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func NewUint32

func NewUint32(val uint32) Uint32

NewUint32 creates a new uint32 option wrapping the given value.

func (Uint32) ForceMapToBool

func (o Uint32) ForceMapToBool(fn func(uint32) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Uint32) ForceMapToByte

func (o Uint32) ForceMapToByte(fn func(uint32) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Uint32) ForceMapToComplex128

func (o Uint32) ForceMapToComplex128(fn func(uint32) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Uint32) ForceMapToComplex64

func (o Uint32) ForceMapToComplex64(fn func(uint32) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Uint32) ForceMapToFloat32

func (o Uint32) ForceMapToFloat32(fn func(uint32) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Uint32) ForceMapToFloat64

func (o Uint32) ForceMapToFloat64(fn func(uint32) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Uint32) ForceMapToInt

func (o Uint32) ForceMapToInt(fn func(uint32) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Uint32) ForceMapToInt16

func (o Uint32) ForceMapToInt16(fn func(uint32) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Uint32) ForceMapToInt32

func (o Uint32) ForceMapToInt32(fn func(uint32) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Uint32) ForceMapToInt64

func (o Uint32) ForceMapToInt64(fn func(uint32) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Uint32) ForceMapToInt8

func (o Uint32) ForceMapToInt8(fn func(uint32) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Uint32) ForceMapToRune

func (o Uint32) ForceMapToRune(fn func(uint32) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Uint32) ForceMapToString

func (o Uint32) ForceMapToString(fn func(uint32) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Uint32) ForceMapToUint

func (o Uint32) ForceMapToUint(fn func(uint32) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Uint32) ForceMapToUint16

func (o Uint32) ForceMapToUint16(fn func(uint32) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Uint32) ForceMapToUint64

func (o Uint32) ForceMapToUint64(fn func(uint32) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Uint32) ForceMapToUint8

func (o Uint32) ForceMapToUint8(fn func(uint32) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Uint32) ForceMapToUntyped

func (o Uint32) ForceMapToUntyped(fn func(uint32) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Uint32) Get

func (o Uint32) Get() uint32

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Uint32) IsNil

func (o Uint32) IsNil() bool

IsNil returns whether or not this option is empty.

func (Uint32) IsPresent

func (o Uint32) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Uint32) MapToBool

func (o Uint32) MapToBool(fn func(uint32) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Uint32) MapToByte

func (o Uint32) MapToByte(fn func(uint32) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Uint32) MapToComplex128

func (o Uint32) MapToComplex128(fn func(uint32) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Uint32) MapToComplex64

func (o Uint32) MapToComplex64(fn func(uint32) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Uint32) MapToFloat32

func (o Uint32) MapToFloat32(fn func(uint32) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Uint32) MapToFloat64

func (o Uint32) MapToFloat64(fn func(uint32) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Uint32) MapToInt

func (o Uint32) MapToInt(fn func(uint32) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Uint32) MapToInt16

func (o Uint32) MapToInt16(fn func(uint32) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Uint32) MapToInt32

func (o Uint32) MapToInt32(fn func(uint32) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Uint32) MapToInt64

func (o Uint32) MapToInt64(fn func(uint32) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Uint32) MapToInt8

func (o Uint32) MapToInt8(fn func(uint32) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Uint32) MapToNillable

func (o Uint32) MapToNillable(fn func(uint32) *uint32) Uint32

MapToNillable either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableBool

func (o Uint32) MapToNillableBool(fn func(uint32) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableByte

func (o Uint32) MapToNillableByte(fn func(uint32) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableComplex128

func (o Uint32) MapToNillableComplex128(fn func(uint32) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableComplex64

func (o Uint32) MapToNillableComplex64(fn func(uint32) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableFloat32

func (o Uint32) MapToNillableFloat32(fn func(uint32) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableFloat64

func (o Uint32) MapToNillableFloat64(fn func(uint32) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableInt

func (o Uint32) MapToNillableInt(fn func(uint32) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableInt16

func (o Uint32) MapToNillableInt16(fn func(uint32) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableInt32

func (o Uint32) MapToNillableInt32(fn func(uint32) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableInt64

func (o Uint32) MapToNillableInt64(fn func(uint32) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableInt8

func (o Uint32) MapToNillableInt8(fn func(uint32) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableRune

func (o Uint32) MapToNillableRune(fn func(uint32) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableString

func (o Uint32) MapToNillableString(fn func(uint32) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableUint

func (o Uint32) MapToNillableUint(fn func(uint32) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableUint16

func (o Uint32) MapToNillableUint16(fn func(uint32) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableUint64

func (o Uint32) MapToNillableUint64(fn func(uint32) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableUint8

func (o Uint32) MapToNillableUint8(fn func(uint32) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Uint32) MapToNillableUntyped

func (o Uint32) MapToNillableUntyped(fn func(uint32) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Uint32) MapToRune

func (o Uint32) MapToRune(fn func(uint32) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Uint32) MapToString

func (o Uint32) MapToString(fn func(uint32) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Uint32) MapToUint

func (o Uint32) MapToUint(fn func(uint32) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Uint32) MapToUint16

func (o Uint32) MapToUint16(fn func(uint32) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Uint32) MapToUint64

func (o Uint32) MapToUint64(fn func(uint32) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Uint32) MapToUint8

func (o Uint32) MapToUint8(fn func(uint32) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Uint32) MapToUntyped

func (o Uint32) MapToUntyped(fn func(uint32) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Uint32) Or

func (o Uint32) Or(def uint32) uint32

Or returns either the value stored in this option or the given default value.

func (Uint32) OrGet

func (o Uint32) OrGet(fn func() uint32) uint32

OrGet returns either the value stored in this option or result of calling the given function.

func (Uint32) OrPanicWith

func (o Uint32) OrPanicWith(fn func() interface{}) uint32

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Uint32) OrPanicWithVal

func (o Uint32) OrPanicWithVal(err interface{}) uint32

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Uint64

type Uint64 struct {
	// contains filtered or unexported fields
}

Uint64 wraps an uint64 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyUint64

func NewEmptyUint64() Uint64

NewEmptyUint64 creates a new empty uint64 option.

func NewMaybeUint64

func NewMaybeUint64(val *uint64) Uint64

NewMaybeUint64 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func NewUint64

func NewUint64(val uint64) Uint64

NewUint64 creates a new uint64 option wrapping the given value.

func (Uint64) ForceMapToBool

func (o Uint64) ForceMapToBool(fn func(uint64) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Uint64) ForceMapToByte

func (o Uint64) ForceMapToByte(fn func(uint64) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Uint64) ForceMapToComplex128

func (o Uint64) ForceMapToComplex128(fn func(uint64) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Uint64) ForceMapToComplex64

func (o Uint64) ForceMapToComplex64(fn func(uint64) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Uint64) ForceMapToFloat32

func (o Uint64) ForceMapToFloat32(fn func(uint64) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Uint64) ForceMapToFloat64

func (o Uint64) ForceMapToFloat64(fn func(uint64) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Uint64) ForceMapToInt

func (o Uint64) ForceMapToInt(fn func(uint64) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Uint64) ForceMapToInt16

func (o Uint64) ForceMapToInt16(fn func(uint64) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Uint64) ForceMapToInt32

func (o Uint64) ForceMapToInt32(fn func(uint64) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Uint64) ForceMapToInt64

func (o Uint64) ForceMapToInt64(fn func(uint64) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Uint64) ForceMapToInt8

func (o Uint64) ForceMapToInt8(fn func(uint64) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Uint64) ForceMapToRune

func (o Uint64) ForceMapToRune(fn func(uint64) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Uint64) ForceMapToString

func (o Uint64) ForceMapToString(fn func(uint64) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Uint64) ForceMapToUint

func (o Uint64) ForceMapToUint(fn func(uint64) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Uint64) ForceMapToUint16

func (o Uint64) ForceMapToUint16(fn func(uint64) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Uint64) ForceMapToUint32

func (o Uint64) ForceMapToUint32(fn func(uint64) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Uint64) ForceMapToUint8

func (o Uint64) ForceMapToUint8(fn func(uint64) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Uint64) ForceMapToUntyped

func (o Uint64) ForceMapToUntyped(fn func(uint64) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Uint64) Get

func (o Uint64) Get() uint64

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Uint64) IsNil

func (o Uint64) IsNil() bool

IsNil returns whether or not this option is empty.

func (Uint64) IsPresent

func (o Uint64) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Uint64) MapToBool

func (o Uint64) MapToBool(fn func(uint64) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Uint64) MapToByte

func (o Uint64) MapToByte(fn func(uint64) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Uint64) MapToComplex128

func (o Uint64) MapToComplex128(fn func(uint64) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Uint64) MapToComplex64

func (o Uint64) MapToComplex64(fn func(uint64) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Uint64) MapToFloat32

func (o Uint64) MapToFloat32(fn func(uint64) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Uint64) MapToFloat64

func (o Uint64) MapToFloat64(fn func(uint64) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Uint64) MapToInt

func (o Uint64) MapToInt(fn func(uint64) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Uint64) MapToInt16

func (o Uint64) MapToInt16(fn func(uint64) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Uint64) MapToInt32

func (o Uint64) MapToInt32(fn func(uint64) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Uint64) MapToInt64

func (o Uint64) MapToInt64(fn func(uint64) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Uint64) MapToInt8

func (o Uint64) MapToInt8(fn func(uint64) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Uint64) MapToNillable

func (o Uint64) MapToNillable(fn func(uint64) *uint64) Uint64

MapToNillable either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableBool

func (o Uint64) MapToNillableBool(fn func(uint64) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableByte

func (o Uint64) MapToNillableByte(fn func(uint64) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableComplex128

func (o Uint64) MapToNillableComplex128(fn func(uint64) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableComplex64

func (o Uint64) MapToNillableComplex64(fn func(uint64) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableFloat32

func (o Uint64) MapToNillableFloat32(fn func(uint64) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableFloat64

func (o Uint64) MapToNillableFloat64(fn func(uint64) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableInt

func (o Uint64) MapToNillableInt(fn func(uint64) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableInt16

func (o Uint64) MapToNillableInt16(fn func(uint64) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableInt32

func (o Uint64) MapToNillableInt32(fn func(uint64) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableInt64

func (o Uint64) MapToNillableInt64(fn func(uint64) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableInt8

func (o Uint64) MapToNillableInt8(fn func(uint64) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableRune

func (o Uint64) MapToNillableRune(fn func(uint64) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableString

func (o Uint64) MapToNillableString(fn func(uint64) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableUint

func (o Uint64) MapToNillableUint(fn func(uint64) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableUint16

func (o Uint64) MapToNillableUint16(fn func(uint64) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableUint32

func (o Uint64) MapToNillableUint32(fn func(uint64) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableUint8

func (o Uint64) MapToNillableUint8(fn func(uint64) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Uint64) MapToNillableUntyped

func (o Uint64) MapToNillableUntyped(fn func(uint64) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Uint64) MapToRune

func (o Uint64) MapToRune(fn func(uint64) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Uint64) MapToString

func (o Uint64) MapToString(fn func(uint64) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Uint64) MapToUint

func (o Uint64) MapToUint(fn func(uint64) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Uint64) MapToUint16

func (o Uint64) MapToUint16(fn func(uint64) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Uint64) MapToUint32

func (o Uint64) MapToUint32(fn func(uint64) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Uint64) MapToUint8

func (o Uint64) MapToUint8(fn func(uint64) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Uint64) MapToUntyped

func (o Uint64) MapToUntyped(fn func(uint64) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Uint64) Or

func (o Uint64) Or(def uint64) uint64

Or returns either the value stored in this option or the given default value.

func (Uint64) OrGet

func (o Uint64) OrGet(fn func() uint64) uint64

OrGet returns either the value stored in this option or result of calling the given function.

func (Uint64) OrPanicWith

func (o Uint64) OrPanicWith(fn func() interface{}) uint64

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Uint64) OrPanicWithVal

func (o Uint64) OrPanicWithVal(err interface{}) uint64

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Uint8

type Uint8 struct {
	// contains filtered or unexported fields
}

Uint8 wraps an uint8 value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyUint8

func NewEmptyUint8() Uint8

NewEmptyUint8 creates a new empty uint8 option.

func NewMaybeUint8

func NewMaybeUint8(val *uint8) Uint8

NewMaybeUint8 creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func NewUint8

func NewUint8(val uint8) Uint8

NewUint8 creates a new uint8 option wrapping the given value.

func (Uint8) ForceMapToBool

func (o Uint8) ForceMapToBool(fn func(uint8) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Uint8) ForceMapToByte

func (o Uint8) ForceMapToByte(fn func(uint8) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Uint8) ForceMapToComplex128

func (o Uint8) ForceMapToComplex128(fn func(uint8) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Uint8) ForceMapToComplex64

func (o Uint8) ForceMapToComplex64(fn func(uint8) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Uint8) ForceMapToFloat32

func (o Uint8) ForceMapToFloat32(fn func(uint8) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Uint8) ForceMapToFloat64

func (o Uint8) ForceMapToFloat64(fn func(uint8) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Uint8) ForceMapToInt

func (o Uint8) ForceMapToInt(fn func(uint8) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Uint8) ForceMapToInt16

func (o Uint8) ForceMapToInt16(fn func(uint8) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Uint8) ForceMapToInt32

func (o Uint8) ForceMapToInt32(fn func(uint8) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Uint8) ForceMapToInt64

func (o Uint8) ForceMapToInt64(fn func(uint8) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Uint8) ForceMapToInt8

func (o Uint8) ForceMapToInt8(fn func(uint8) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Uint8) ForceMapToRune

func (o Uint8) ForceMapToRune(fn func(uint8) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Uint8) ForceMapToString

func (o Uint8) ForceMapToString(fn func(uint8) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Uint8) ForceMapToUint

func (o Uint8) ForceMapToUint(fn func(uint8) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Uint8) ForceMapToUint16

func (o Uint8) ForceMapToUint16(fn func(uint8) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Uint8) ForceMapToUint32

func (o Uint8) ForceMapToUint32(fn func(uint8) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Uint8) ForceMapToUint64

func (o Uint8) ForceMapToUint64(fn func(uint8) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Uint8) ForceMapToUntyped

func (o Uint8) ForceMapToUntyped(fn func(uint8) interface{}) Untyped

ForceMapToUntyped either returns an empty option of interface{} if this option is empty, or returns a new option of interface{} wrapping the result of the given function.

Since "interface{}" is a nillable type, the resulting option will be empty if the return value was nil.

func (Uint8) Get

func (o Uint8) Get() uint8

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Uint8) IsNil

func (o Uint8) IsNil() bool

IsNil returns whether or not this option is empty.

func (Uint8) IsPresent

func (o Uint8) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Uint8) MapToBool

func (o Uint8) MapToBool(fn func(uint8) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Uint8) MapToByte

func (o Uint8) MapToByte(fn func(uint8) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Uint8) MapToComplex128

func (o Uint8) MapToComplex128(fn func(uint8) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Uint8) MapToComplex64

func (o Uint8) MapToComplex64(fn func(uint8) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Uint8) MapToFloat32

func (o Uint8) MapToFloat32(fn func(uint8) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Uint8) MapToFloat64

func (o Uint8) MapToFloat64(fn func(uint8) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Uint8) MapToInt

func (o Uint8) MapToInt(fn func(uint8) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Uint8) MapToInt16

func (o Uint8) MapToInt16(fn func(uint8) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Uint8) MapToInt32

func (o Uint8) MapToInt32(fn func(uint8) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Uint8) MapToInt64

func (o Uint8) MapToInt64(fn func(uint8) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Uint8) MapToInt8

func (o Uint8) MapToInt8(fn func(uint8) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Uint8) MapToNillable

func (o Uint8) MapToNillable(fn func(uint8) *uint8) Uint8

MapToNillable either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableBool

func (o Uint8) MapToNillableBool(fn func(uint8) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableByte

func (o Uint8) MapToNillableByte(fn func(uint8) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableComplex128

func (o Uint8) MapToNillableComplex128(fn func(uint8) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableComplex64

func (o Uint8) MapToNillableComplex64(fn func(uint8) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableFloat32

func (o Uint8) MapToNillableFloat32(fn func(uint8) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableFloat64

func (o Uint8) MapToNillableFloat64(fn func(uint8) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableInt

func (o Uint8) MapToNillableInt(fn func(uint8) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableInt16

func (o Uint8) MapToNillableInt16(fn func(uint8) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableInt32

func (o Uint8) MapToNillableInt32(fn func(uint8) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableInt64

func (o Uint8) MapToNillableInt64(fn func(uint8) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableInt8

func (o Uint8) MapToNillableInt8(fn func(uint8) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableRune

func (o Uint8) MapToNillableRune(fn func(uint8) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableString

func (o Uint8) MapToNillableString(fn func(uint8) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableUint

func (o Uint8) MapToNillableUint(fn func(uint8) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableUint16

func (o Uint8) MapToNillableUint16(fn func(uint8) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableUint32

func (o Uint8) MapToNillableUint32(fn func(uint8) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableUint64

func (o Uint8) MapToNillableUint64(fn func(uint8) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Uint8) MapToNillableUntyped

func (o Uint8) MapToNillableUntyped(fn func(uint8) *interface{}) Untyped

MapToNillableUntyped either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Uint8) MapToRune

func (o Uint8) MapToRune(fn func(uint8) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Uint8) MapToString

func (o Uint8) MapToString(fn func(uint8) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Uint8) MapToUint

func (o Uint8) MapToUint(fn func(uint8) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Uint8) MapToUint16

func (o Uint8) MapToUint16(fn func(uint8) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Uint8) MapToUint32

func (o Uint8) MapToUint32(fn func(uint8) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Uint8) MapToUint64

func (o Uint8) MapToUint64(fn func(uint8) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Uint8) MapToUntyped

func (o Uint8) MapToUntyped(fn func(uint8) (interface{}, error)) (Untyped, error)

MapToUntyped either returns an empty option of interface{} if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned interface{} option will be empty.

Since "interface{}" is a nillable type, the resulting will be empty if the return value was nil.

func (Uint8) Or

func (o Uint8) Or(def uint8) uint8

Or returns either the value stored in this option or the given default value.

func (Uint8) OrGet

func (o Uint8) OrGet(fn func() uint8) uint8

OrGet returns either the value stored in this option or result of calling the given function.

func (Uint8) OrPanicWith

func (o Uint8) OrPanicWith(fn func() interface{}) uint8

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Uint8) OrPanicWithVal

func (o Uint8) OrPanicWithVal(err interface{}) uint8

OrPanicWithVal returns the value stored in this option or panics with the given value.

type Untyped

type Untyped struct {
	// contains filtered or unexported fields
}

Untyped wraps an interface{} value that may or may not exist.

The value inside this struct cannot be modified (except maybe through reflection).

func NewEmptyUntyped

func NewEmptyUntyped() Untyped

NewEmptyUntyped creates a new empty interface{} option.

func NewMaybeUntyped

func NewMaybeUntyped(val *interface{}) Untyped

NewMaybeUntyped creates a new option from the given pointer.

If the pointer is nil, the resulting option will be empty, else the option will contain the value the pointer points to.

Note, the value will be copied when wrapped.

func NewUntyped

func NewUntyped(val interface{}) Untyped

NewUntyped creates a new interface{} option wrapping the given value.

If the value given to this function is nil, this function will panic.

func (Untyped) ForceMapToBool

func (o Untyped) ForceMapToBool(fn func(interface{}) bool) Bool

ForceMapToBool either returns an empty option of bool if this option is empty, or returns a new option of bool wrapping the result of the given function.

func (Untyped) ForceMapToByte

func (o Untyped) ForceMapToByte(fn func(interface{}) byte) Byte

ForceMapToByte either returns an empty option of byte if this option is empty, or returns a new option of byte wrapping the result of the given function.

func (Untyped) ForceMapToComplex128

func (o Untyped) ForceMapToComplex128(fn func(interface{}) complex128) Complex128

ForceMapToComplex128 either returns an empty option of complex128 if this option is empty, or returns a new option of complex128 wrapping the result of the given function.

func (Untyped) ForceMapToComplex64

func (o Untyped) ForceMapToComplex64(fn func(interface{}) complex64) Complex64

ForceMapToComplex64 either returns an empty option of complex64 if this option is empty, or returns a new option of complex64 wrapping the result of the given function.

func (Untyped) ForceMapToFloat32

func (o Untyped) ForceMapToFloat32(fn func(interface{}) float32) Float32

ForceMapToFloat32 either returns an empty option of float32 if this option is empty, or returns a new option of float32 wrapping the result of the given function.

func (Untyped) ForceMapToFloat64

func (o Untyped) ForceMapToFloat64(fn func(interface{}) float64) Float64

ForceMapToFloat64 either returns an empty option of float64 if this option is empty, or returns a new option of float64 wrapping the result of the given function.

func (Untyped) ForceMapToInt

func (o Untyped) ForceMapToInt(fn func(interface{}) int) Int

ForceMapToInt either returns an empty option of int if this option is empty, or returns a new option of int wrapping the result of the given function.

func (Untyped) ForceMapToInt16

func (o Untyped) ForceMapToInt16(fn func(interface{}) int16) Int16

ForceMapToInt16 either returns an empty option of int16 if this option is empty, or returns a new option of int16 wrapping the result of the given function.

func (Untyped) ForceMapToInt32

func (o Untyped) ForceMapToInt32(fn func(interface{}) int32) Int32

ForceMapToInt32 either returns an empty option of int32 if this option is empty, or returns a new option of int32 wrapping the result of the given function.

func (Untyped) ForceMapToInt64

func (o Untyped) ForceMapToInt64(fn func(interface{}) int64) Int64

ForceMapToInt64 either returns an empty option of int64 if this option is empty, or returns a new option of int64 wrapping the result of the given function.

func (Untyped) ForceMapToInt8

func (o Untyped) ForceMapToInt8(fn func(interface{}) int8) Int8

ForceMapToInt8 either returns an empty option of int8 if this option is empty, or returns a new option of int8 wrapping the result of the given function.

func (Untyped) ForceMapToRune

func (o Untyped) ForceMapToRune(fn func(interface{}) rune) Rune

ForceMapToRune either returns an empty option of rune if this option is empty, or returns a new option of rune wrapping the result of the given function.

func (Untyped) ForceMapToString

func (o Untyped) ForceMapToString(fn func(interface{}) string) String

ForceMapToString either returns an empty option of string if this option is empty, or returns a new option of string wrapping the result of the given function.

func (Untyped) ForceMapToUint

func (o Untyped) ForceMapToUint(fn func(interface{}) uint) Uint

ForceMapToUint either returns an empty option of uint if this option is empty, or returns a new option of uint wrapping the result of the given function.

func (Untyped) ForceMapToUint16

func (o Untyped) ForceMapToUint16(fn func(interface{}) uint16) Uint16

ForceMapToUint16 either returns an empty option of uint16 if this option is empty, or returns a new option of uint16 wrapping the result of the given function.

func (Untyped) ForceMapToUint32

func (o Untyped) ForceMapToUint32(fn func(interface{}) uint32) Uint32

ForceMapToUint32 either returns an empty option of uint32 if this option is empty, or returns a new option of uint32 wrapping the result of the given function.

func (Untyped) ForceMapToUint64

func (o Untyped) ForceMapToUint64(fn func(interface{}) uint64) Uint64

ForceMapToUint64 either returns an empty option of uint64 if this option is empty, or returns a new option of uint64 wrapping the result of the given function.

func (Untyped) ForceMapToUint8

func (o Untyped) ForceMapToUint8(fn func(interface{}) uint8) Uint8

ForceMapToUint8 either returns an empty option of uint8 if this option is empty, or returns a new option of uint8 wrapping the result of the given function.

func (Untyped) Get

func (o Untyped) Get() interface{}

Get returns the value stored in this option or panics with a default empty unwrap error message.

func (Untyped) IsNil

func (o Untyped) IsNil() bool

IsNil returns whether or not this option is empty.

func (Untyped) IsPresent

func (o Untyped) IsPresent() bool

IsPresent returns whether or not this option has a value.

func (Untyped) MapToBool

func (o Untyped) MapToBool(fn func(interface{}) (bool, error)) (Bool, error)

MapToBool either returns an empty option of bool if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned bool option will be empty.

func (Untyped) MapToByte

func (o Untyped) MapToByte(fn func(interface{}) (byte, error)) (Byte, error)

MapToByte either returns an empty option of byte if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned byte option will be empty.

func (Untyped) MapToComplex128

func (o Untyped) MapToComplex128(fn func(interface{}) (complex128, error)) (Complex128, error)

MapToComplex128 either returns an empty option of complex128 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex128 option will be empty.

func (Untyped) MapToComplex64

func (o Untyped) MapToComplex64(fn func(interface{}) (complex64, error)) (Complex64, error)

MapToComplex64 either returns an empty option of complex64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned complex64 option will be empty.

func (Untyped) MapToFloat32

func (o Untyped) MapToFloat32(fn func(interface{}) (float32, error)) (Float32, error)

MapToFloat32 either returns an empty option of float32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float32 option will be empty.

func (Untyped) MapToFloat64

func (o Untyped) MapToFloat64(fn func(interface{}) (float64, error)) (Float64, error)

MapToFloat64 either returns an empty option of float64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned float64 option will be empty.

func (Untyped) MapToInt

func (o Untyped) MapToInt(fn func(interface{}) (int, error)) (Int, error)

MapToInt either returns an empty option of int if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int option will be empty.

func (Untyped) MapToInt16

func (o Untyped) MapToInt16(fn func(interface{}) (int16, error)) (Int16, error)

MapToInt16 either returns an empty option of int16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int16 option will be empty.

func (Untyped) MapToInt32

func (o Untyped) MapToInt32(fn func(interface{}) (int32, error)) (Int32, error)

MapToInt32 either returns an empty option of int32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int32 option will be empty.

func (Untyped) MapToInt64

func (o Untyped) MapToInt64(fn func(interface{}) (int64, error)) (Int64, error)

MapToInt64 either returns an empty option of int64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int64 option will be empty.

func (Untyped) MapToInt8

func (o Untyped) MapToInt8(fn func(interface{}) (int8, error)) (Int8, error)

MapToInt8 either returns an empty option of int8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned int8 option will be empty.

func (Untyped) MapToNillable

func (o Untyped) MapToNillable(fn func(interface{}) *interface{}) Untyped

MapToNillable either returns an empty option of interface{} if this option is empty, or returns a new interface{} option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableBool

func (o Untyped) MapToNillableBool(fn func(interface{}) *bool) Bool

MapToNillableBool either returns an empty option of bool if this option is empty, or returns a new bool option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableByte

func (o Untyped) MapToNillableByte(fn func(interface{}) *byte) Byte

MapToNillableByte either returns an empty option of byte if this option is empty, or returns a new byte option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableComplex128

func (o Untyped) MapToNillableComplex128(fn func(interface{}) *complex128) Complex128

MapToNillableComplex128 either returns an empty option of complex128 if this option is empty, or returns a new complex128 option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableComplex64

func (o Untyped) MapToNillableComplex64(fn func(interface{}) *complex64) Complex64

MapToNillableComplex64 either returns an empty option of complex64 if this option is empty, or returns a new complex64 option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableFloat32

func (o Untyped) MapToNillableFloat32(fn func(interface{}) *float32) Float32

MapToNillableFloat32 either returns an empty option of float32 if this option is empty, or returns a new float32 option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableFloat64

func (o Untyped) MapToNillableFloat64(fn func(interface{}) *float64) Float64

MapToNillableFloat64 either returns an empty option of float64 if this option is empty, or returns a new float64 option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableInt

func (o Untyped) MapToNillableInt(fn func(interface{}) *int) Int

MapToNillableInt either returns an empty option of int if this option is empty, or returns a new int option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableInt16

func (o Untyped) MapToNillableInt16(fn func(interface{}) *int16) Int16

MapToNillableInt16 either returns an empty option of int16 if this option is empty, or returns a new int16 option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableInt32

func (o Untyped) MapToNillableInt32(fn func(interface{}) *int32) Int32

MapToNillableInt32 either returns an empty option of int32 if this option is empty, or returns a new int32 option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableInt64

func (o Untyped) MapToNillableInt64(fn func(interface{}) *int64) Int64

MapToNillableInt64 either returns an empty option of int64 if this option is empty, or returns a new int64 option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableInt8

func (o Untyped) MapToNillableInt8(fn func(interface{}) *int8) Int8

MapToNillableInt8 either returns an empty option of int8 if this option is empty, or returns a new int8 option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableRune

func (o Untyped) MapToNillableRune(fn func(interface{}) *rune) Rune

MapToNillableRune either returns an empty option of rune if this option is empty, or returns a new rune option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableString

func (o Untyped) MapToNillableString(fn func(interface{}) *string) String

MapToNillableString either returns an empty option of string if this option is empty, or returns a new string option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableUint

func (o Untyped) MapToNillableUint(fn func(interface{}) *uint) Uint

MapToNillableUint either returns an empty option of uint if this option is empty, or returns a new uint option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableUint16

func (o Untyped) MapToNillableUint16(fn func(interface{}) *uint16) Uint16

MapToNillableUint16 either returns an empty option of uint16 if this option is empty, or returns a new uint16 option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableUint32

func (o Untyped) MapToNillableUint32(fn func(interface{}) *uint32) Uint32

MapToNillableUint32 either returns an empty option of uint32 if this option is empty, or returns a new uint32 option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableUint64

func (o Untyped) MapToNillableUint64(fn func(interface{}) *uint64) Uint64

MapToNillableUint64 either returns an empty option of uint64 if this option is empty, or returns a new uint64 option of either some or none based on the value returned by the function.

func (Untyped) MapToNillableUint8

func (o Untyped) MapToNillableUint8(fn func(interface{}) *uint8) Uint8

MapToNillableUint8 either returns an empty option of uint8 if this option is empty, or returns a new uint8 option of either some or none based on the value returned by the function.

func (Untyped) MapToRune

func (o Untyped) MapToRune(fn func(interface{}) (rune, error)) (Rune, error)

MapToRune either returns an empty option of rune if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned rune option will be empty.

func (Untyped) MapToString

func (o Untyped) MapToString(fn func(interface{}) (string, error)) (String, error)

MapToString either returns an empty option of string if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned string option will be empty.

func (Untyped) MapToUint

func (o Untyped) MapToUint(fn func(interface{}) (uint, error)) (Uint, error)

MapToUint either returns an empty option of uint if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint option will be empty.

func (Untyped) MapToUint16

func (o Untyped) MapToUint16(fn func(interface{}) (uint16, error)) (Uint16, error)

MapToUint16 either returns an empty option of uint16 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint16 option will be empty.

func (Untyped) MapToUint32

func (o Untyped) MapToUint32(fn func(interface{}) (uint32, error)) (Uint32, error)

MapToUint32 either returns an empty option of uint32 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint32 option will be empty.

func (Untyped) MapToUint64

func (o Untyped) MapToUint64(fn func(interface{}) (uint64, error)) (Uint64, error)

MapToUint64 either returns an empty option of uint64 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint64 option will be empty.

func (Untyped) MapToUint8

func (o Untyped) MapToUint8(fn func(interface{}) (uint8, error)) (Uint8, error)

MapToUint8 either returns an empty option of uint8 if this option is empty, or calls the given function and returns an option wrapping the result.

If the given function returns an error, the returned uint8 option will be empty.

func (Untyped) Or

func (o Untyped) Or(def interface{}) interface{}

Or returns either the value stored in this option or the given default value.

func (Untyped) OrGet

func (o Untyped) OrGet(fn func() interface{}) interface{}

OrGet returns either the value stored in this option or result of calling the given function.

func (Untyped) OrPanicWith

func (o Untyped) OrPanicWith(fn func() interface{}) interface{}

OrPanicWith returns the value stored in this option or panics with the value returned by the given function.

func (Untyped) OrPanicWithVal

func (o Untyped) OrPanicWithVal(err interface{}) interface{}

OrPanicWithVal returns the value stored in this option or panics with the given value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL