[][src]Trait vec_utils::Try

pub trait Try {
    type Ok;
    type Error;
    fn into_result(self) -> Result<Self::Ok, Self::Error>;
fn from_error(v: Self::Error) -> Self;
fn from_ok(v: Self::Ok) -> Self; }

A stable version of core::ops::Try.

Associated Types

type Ok

The type of this value when viewed as successful.

type Error

The type of this value when viewed as failed.

Loading content...

Required methods

fn into_result(self) -> Result<Self::Ok, Self::Error>

A return of Ok(t) means that the execution should continue normally, and the result of ? is the value t. A return of Err(e) means that execution should branch to the innermost enclosing catch, or return from the function.

fn from_error(v: Self::Error) -> Self

Wrap an error value to construct the composite result. For example, Result::Err(x) and Result::from_error(x) are equivalent.

fn from_ok(v: Self::Ok) -> Self

Wrap an OK value to construct the composite result. For example, Result::Ok(x) and Result::from_ok(x) are equivalent.

Loading content...

Implementations on Foreign Types

impl<T, E> Try for Result<T, E>[src]

type Ok = T

type Error = E

impl<T> Try for Option<T>[src]

type Ok = T

type Error = NoneError

impl<T, E> Try for Poll<Option<Result<T, E>>>[src]

type Ok = Poll<Option<T>>

type Error = E

impl<T, E> Try for Poll<Result<T, E>>[src]

type Ok = Poll<T>

type Error = E

Loading content...

Implementors

Loading content...