option

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 0 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply[T any, O Mutable[T]](opts T, options ...O)

func ApplyAll

func ApplyAll[T any, O Mutable[T]](opts T, options []O)

func Mut

func Mut[T any, P ptr[T], I Immutable[T]](option func(P)) I

func TryApply

func TryApply[T any, O Maybe[T]](opts T, options ...O) error

func TryApplyAll

func TryApplyAll[T any, O Maybe[T]](opts T, options []O) error

func With

func With[T any, O Immutable[T]](opts T, options ...O) T

func WithAll

func WithAll[T any, O Immutable[T]](opts T, options []O) T

Types

type Immutable

type Immutable[T any] interface {
	~func(T) T
}

type Maybe

type Maybe[T any] interface {
	~func(T) error
}

type Mutable

type Mutable[T any] interface {
	~func(T)
}

type Option

type Option[T any] interface {
	Mutable[T] | Immutable[T] | Maybe[T]
}

Jump to

Keyboard shortcuts

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