ResultExtensions

Trait ResultExtensions 

Source
pub trait ResultExtensions
where Self: Sized,
{ // Provided methods fn to_ok<E>(self) -> Result<Self, E> { ... } fn to_err<T>(self) -> Result<T, Self> { ... } }
Expand description

Allows any Sized type to be functionally moved into a Result<T, E>.

Provided Methods§

Source

fn to_ok<E>(self) -> Result<Self, E>

Converts the caller into an Ok (left-hand-side) Result.

Source

fn to_err<T>(self) -> Result<T, Self>

Converts the caller into an Err (right-hand-side) Result.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§