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

transposeResultToOption

Transposes a Result of an Option into an Option of a Result.

  • Ok(Some(v)) -> Some(Ok(v))
  • Ok(None) -> None
  • Err(e) -> Some(Err(e))
function transposeResultToOption<T, E>(input: Result<Option<T>, E>): Option<Result<T, E>>;
§
transposeResultToOption<T, E>(input: Result<Option<T>, E>): Option<Result<T, E>>
[src]

§Type Parameters

§Parameters

§
input: Result<Option<T>, E>
[src]

§Return Type

§
Option<Result<T, E>>
[src]