Documentation ¶
Index ¶
- Variables
- func RecoverIfPanic[T any](resultReference *Result[T])
- type PanickedError
- type Result
- func (opt Result[T]) Accept(f func(*T)) (nextResult Result[T])
- func (opt Result[T]) Fail(f func(e error)) Result[T]
- func (opt Result[T]) IsOk() bool
- func (opt *Result[T]) SetFail(v error) *Result[T]
- func (opt *Result[T]) SetOk(v T) *Result[T]
- func (r Result[T]) String() string
- func (opt Result[T]) Then(f func(*T) *Result[T]) Result[T]
- func (opt Result[T]) Unwrap() T
- func (opt Result[T]) UnwrapError() error
- func (opt Result[T]) UnwrapOrDefault(def T) T
- func (opt Result[T]) UnwrapOrPanic(msg string) T
Constants ¶
This section is empty.
Variables ¶
View Source
var CaptureStackOnPanic = true
Functions ¶
func RecoverIfPanic ¶ added in v1.0.4
Types ¶
type PanickedError ¶ added in v1.0.4
func (PanickedError) Error ¶ added in v1.0.4
func (pe PanickedError) Error() string
type Result ¶
type Result[T any] struct { // contains filtered or unexported fields }
func ResultFailed ¶
func (Result[T]) UnwrapError ¶
func (Result[T]) UnwrapOrDefault ¶ added in v1.0.5
func (opt Result[T]) UnwrapOrDefault(def T) T
func (Result[T]) UnwrapOrPanic ¶ added in v1.0.6
Click to show internal directories.
Click to hide internal directories.