Skip to content

Class.DisposableResult

GitHub Actions edited this page Apr 10, 2024 · 5 revisions

resultar / DisposableResult

Class: DisposableResult<T, E>

A Disposable is an object that has a dispose method that can be used to clean up resources.

Type parameters

T

E

Implements

  • Resultable<T, E>
  • Disposable

Constructors

new DisposableResult(result, finalizer)

new DisposableResult<T, E>(result, finalizer): DisposableResult<T, E>

Parameters

result: Resultable<T, E>

finalizer

Returns

DisposableResult<T, E>

Source

result.ts:393

Properties

finalizer()

private readonly finalizer: (value, error) => void

Parameters

value: T

error: E

Returns

void

Source

result.ts:394


result

readonly result: Resultable<T, E>

Source

result.ts:393

Accessors

error

get error(): E

Returns

E

Source

result.ts:400


value

get value(): T

Returns

T

Source

result.ts:396

Methods

[dispose]()

[dispose](): void

Returns

void

Implementation of

Disposable.[dispose]

Source

result.ts:424


_unsafeUnwrap()

_unsafeUnwrap(config?): T

Parameters

config?: ErrorConfig

Returns

T

Implementation of

Resultable._unsafeUnwrap

Source

result.ts:404


_unsafeUnwrapErr()

_unsafeUnwrapErr(config?): E

Parameters

config?: ErrorConfig

Returns

E

Implementation of

Resultable._unsafeUnwrapErr

Source

result.ts:408


isErr()

isErr(): boolean

Returns

boolean

Implementation of

Resultable.isErr

Source

result.ts:416


isOk()

isOk(): boolean

Returns

boolean

Implementation of

Resultable.isOk

Source

result.ts:412


unwrapOr()

unwrapOr<A>(defaultValue): T | A

Type parameters

A

Parameters

defaultValue: A

Returns

T | A

Implementation of

Resultable.unwrapOr

Source

result.ts:420