nullable

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Nullable

type Nullable[T any] struct {
	Value    T
	HasValue bool
}

func Value

func Value[T any](value T) Nullable[T]

func ValueFromPtr

func ValueFromPtr[T any](value *T) Nullable[T]

func (Nullable[T]) Equal

func (n Nullable[T]) Equal(other Nullable[T]) bool

func (Nullable[T]) ExactEqual

func (n Nullable[T]) ExactEqual(other Nullable[T]) bool

func (Nullable[T]) MarshalJSON

func (n Nullable[T]) MarshalJSON() ([]byte, error)

func (Nullable[T]) MarshalText

func (n Nullable[T]) MarshalText() ([]byte, error)

func (Nullable[T]) String

func (n Nullable[T]) String() string

func (*Nullable[T]) UnmarshalJSON

func (n *Nullable[T]) UnmarshalJSON(data []byte) error

func (*Nullable[T]) UnmarshalText

func (n *Nullable[T]) UnmarshalText(text []byte) error

func (Nullable[T]) ValueOrZero

func (n Nullable[T]) ValueOrZero() T

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL