resultx

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func At added in v0.0.34

func At[T any](rs Results, i int) T

func Unwrap

func Unwrap[T any](v T, e error) T

func UnwrapB

func UnwrapB[T any](v T, b bool) T

Types

type R

type R interface {
	bool | struct {
		// contains filtered or unexported fields
	}
}

type Result

type Result[T any] struct {
	// contains filtered or unexported fields
}

func Err

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

func Succeed

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

func WrapResult

func WrapResult[T any](v T, e error) Result[T]

func (Result) Failed

func (r Result) Failed() bool

func (Result) Succeed

func (r Result) Succeed() bool

func (Result) Unwrap

func (r Result) Unwrap() T

func (Result) UnwrapOr

func (r Result) UnwrapOr(v T) T

type ResultB

type ResultB[T any] struct {
	// contains filtered or unexported fields
}

func NotOK

func NotOK[T any]() ResultB[T]

func OK

func OK[T any](v T) ResultB[T]

func WrapResultB

func WrapResultB[T any](v T, b bool) ResultB[T]

func (ResultB) Failed

func (r ResultB) Failed() bool

func (ResultB) Succeed

func (r ResultB) Succeed() bool

func (ResultB) Unwrap

func (r ResultB) Unwrap() T

func (ResultB) UnwrapOr

func (r ResultB) UnwrapOr(v T) T

type Results added in v0.0.34

type Results []any

func ResultsOf added in v0.0.34

func ResultsOf(rs ...any) Results

func (Results) At added in v0.0.34

func (rs Results) At(i int) any

Jump to

Keyboard shortcuts

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