Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Err

This type contain a failure information E.

You can create this type value and get an inner value in this type by hand. But we recommend to use the factory {@link createErr()} and utility functions for forward compatibility. And we don't recommend to implement this type for your type too.

  • {@link createErr()} to create a value of Err(E).
  • {@link isErr()} to check whether the value is Err(E).
  • {@link unwrapErr()} to get an inner failure information in Err(E).
  • ...and more.
interface Err <E> {
readonly err: E;
readonly ok: false;
readonly val: null;
}

§Type Parameters

§Properties

§
readonly err: E
[src]

Don't touch this property directly from an user project except 3rd party project that does not install this package but uses a value returned from an other project. Instead, use {@link unwrapErr()} operator to get an inner value.

Historically, this type was created to target a JSVM that supports ES5. Then there was no well optimized Symbol to achieve a private property. We don't have a plan to change this into private property keep the backward compatibility.

§
readonly ok: false
[src]

Don't touch this property directly from an user project except 3rd party project that does not install this package but uses a value returned from an other project. Instead, use {@link isOk()} or {@link isErr()} operator to get an inner value.

Historically, this type was created to target a JSVM that supports ES5. Then there was no well optimized Symbol to achieve a private property. We don't have a plan to change this into private property keep the backward compatibility.

§
readonly val: null
[src]

Don't touch this property directly from an user project except 3rd party project that does not install this package but uses a value returned from an other project. Instead, use {@link unwrapOk()} operator to get an inner value.

Historically, this type was created to target a JSVM that supports ES5. Then there was no well optimized Symbol to achieve a private property. We don't have a plan to change this into private property keep the backward compatibility.