Documentation ¶
Index ¶
- type OptionalPair
- func (b OptionalPair[A, B]) Get() (Pair[A, B], error)
- func (b OptionalPair[A, B]) If(fn func(Pair[A, B]))
- func (b OptionalPair[A, B]) MarshalJSON() ([]byte, error)
- func (b OptionalPair[A, B]) MustGet() Pair[A, B]
- func (b OptionalPair[A, B]) OrElse(v Pair[A, B]) Pair[A, B]
- func (b OptionalPair[A, B]) Present() bool
- func (b *OptionalPair[A, B]) Set(v Pair[A, B])
- func (b OptionalPair[A, B]) ToPtr() *Pair[A, B]
- func (b *OptionalPair[A, B]) UnmarshalJSON(data []byte) error
- type Pair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OptionalPair ¶
OptionalPair is an optional pair.
func NewOptionalPair ¶
func NewOptionalPair[A any, B any](v Pair[A, B]) OptionalPair[A, B]
NewOptionalPair creates an optional.OptionalPair from a pair.
func NewOptionalPairFromPtr ¶
func NewOptionalPairFromPtr[A any, B any](v *Pair[A, B]) OptionalPair[A, B]
NewOptionalPairFromPtr creates an optional.OptionalPair from a pair pointer.
func (OptionalPair[A, B]) Get ¶
func (b OptionalPair[A, B]) Get() (Pair[A, B], error)
Get returns the pair value or an error if not present.
func (OptionalPair[A, B]) If ¶
func (b OptionalPair[A, B]) If(fn func(Pair[A, B]))
If calls the function f with the value if the value is present.
func (OptionalPair[A, B]) MarshalJSON ¶
func (b OptionalPair[A, B]) MarshalJSON() ([]byte, error)
func (OptionalPair[A, B]) MustGet ¶
func (b OptionalPair[A, B]) MustGet() Pair[A, B]
MustGet returns the pair value or panics if not present.
func (OptionalPair[A, B]) OrElse ¶
func (b OptionalPair[A, B]) OrElse(v Pair[A, B]) Pair[A, B]
OrElse returns the pair value or a default value if the value is not present.
func (OptionalPair[A, B]) Present ¶
func (b OptionalPair[A, B]) Present() bool
Present returns whether or not the value is present.
func (*OptionalPair[A, B]) Set ¶
func (b *OptionalPair[A, B]) Set(v Pair[A, B])
Set sets the pair value.
func (OptionalPair[A, B]) ToPtr ¶
func (b OptionalPair[A, B]) ToPtr() *Pair[A, B]
ToPtr returns a *pair of the value or nil if not present.
func (*OptionalPair[A, B]) UnmarshalJSON ¶
func (b *OptionalPair[A, B]) UnmarshalJSON(data []byte) error
Directories ¶
Path | Synopsis |
---|---|
Package CnsPanel provides a structure and functions for handling console command flags.
|
Package CnsPanel provides a structure and functions for handling console command flags. |
Package Counters provides a set of interfaces and methods for managing counters.
|
Package Counters provides a set of interfaces and methods for managing counters. |
Package Helpers provides a set of helper functions and types that can be used for automatic error handling and result evaluation.
|
Package Helpers provides a set of helper functions and types that can be used for automatic error handling and result evaluation. |
Package PageInterval provides a data structure for managing page intervals.
|
Package PageInterval provides a data structure for managing page intervals. |
Click to show internal directories.
Click to hide internal directories.