result

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: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result[T any] func() (T, error)

func Bind

func Bind[T, V any](r Result[T], fn func(T) Result[V]) Result[V]

func Err

func Err[T any](err error) Result[T]

func Error

func Error[T any](text string) Result[T]

func Errorf

func Errorf[T any](format string, a ...any) Result[T]

func From

func From[T any](v T, err error) Result[T]

func Id

func Id[T any](r Result[T]) Result[T]

func Map

func Map[T, V any](r Result[T], fn func(T) V) Result[V]

func Ok

func Ok[T any](v T) Result[T]

func (Result[T]) Err

func (r Result[T]) Err() error

func (Result[T]) IsErr

func (r Result[T]) IsErr() bool

func (Result[T]) IsOk

func (r Result[T]) IsOk() bool

func (Result[T]) Unwrap

func (r Result[T]) Unwrap() (T, error)

func (Result[T]) Value

func (r Result[T]) Value() T

type Result2 added in v0.0.11

type Result2[T, V any] func() (T, V, error)

Jump to

Keyboard shortcuts

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