Documentation
¶
Index ¶
- type Error
- func (err Error[T]) Error(call func(error) Result[T]) Result[T]
- func (err Error[T]) Is(value T) bool
- func (err Error[T]) IsError(value error) bool
- func (err Error[T]) Or(value T) Result[T]
- func (err Error[T]) String() string
- func (err Error[T]) Then(func(T) Result[T]) Result[T]
- func (err Error[T]) TryError() error
- func (err Error[T]) TryValue() T
- func (err Error[T]) WhenError(call func(error)) Result[T]
- func (err Error[T]) WhenOK(call func(T)) Result[T]
- type Maybe
- type MaybeIsNothingError
- type Nothing
- func (nothing Nothing[T]) Else(call func() Maybe[T]) Maybe[T]
- func (nothing Nothing[T]) Is(value T) bool
- func (nothing Nothing[T]) Or(value T) Maybe[T]
- func (Nothing[T]) String() string
- func (nothing Nothing[T]) Then(call func(T) Maybe[T]) Maybe[T]
- func (Nothing[T]) TryValue() T
- func (nothing Nothing[T]) WhenNothing(call func()) Maybe[T]
- func (nothing Nothing[T]) WhenValue(call func(T)) Maybe[T]
- type OK
- func (ok OK[T]) Error(func(error) Result[T]) Result[T]
- func (ok OK[T]) Is(value T) bool
- func (ok OK[T]) IsError(error) bool
- func (ok OK[T]) Or(T) Result[T]
- func (ok OK[T]) String() string
- func (ok OK[T]) Then(call func(T) Result[T]) Result[T]
- func (ok OK[T]) TryError() error
- func (ok OK[T]) TryValue() T
- func (ok OK[T]) WhenError(func(error)) Result[T]
- func (ok OK[T]) WhenOK(call func(T)) Result[T]
- type Result
- type ResultIsErrorError
- type ResultIsOkError
- type Some
- func (some Some[T]) Else(func() Maybe[T]) Maybe[T]
- func (some Some[T]) Is(value T) bool
- func (some Some[T]) Or(T) Maybe[T]
- func (some Some[T]) String() string
- func (some Some[T]) Then(call func(T) Maybe[T]) Maybe[T]
- func (some Some[T]) TryValue() T
- func (some Some[T]) WhenNothing(func()) Maybe[T]
- func (some Some[T]) WhenValue(call func(T)) Maybe[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Maybe ¶
type MaybeIsNothingError ¶
type MaybeIsNothingError struct {
// contains filtered or unexported fields
}
func NewMaybeIsNothingError ¶
func NewMaybeIsNothingError() MaybeIsNothingError
type Result ¶
type Result[T any] interface { Then(call func(T) Result[T]) Result[T] Error(call func(error) Result[T]) Result[T] WhenOK(call func(T)) Result[T] WhenError(call func(error)) Result[T] Or(value T) Result[T] Is(value T) bool IsError(value error) bool TryValue() T TryError() error // contains filtered or unexported methods }
type ResultIsErrorError ¶
type ResultIsErrorError struct {
Err error
// contains filtered or unexported fields
}
func NewResultIsErrorError ¶
func NewResultIsErrorError(err error) ResultIsErrorError
type ResultIsOkError ¶
type ResultIsOkError struct {
// contains filtered or unexported fields
}
func NewResultIsOkError ¶
func NewResultIsOkError() ResultIsOkError
Click to show internal directories.
Click to hide internal directories.