Trait near_async::test_loop::event_handler::TryIntoOrSelf

source ·
pub trait TryIntoOrSelf<R>: Sized {
    // Required method
    fn try_into_or_self(self) -> Result<R, Self>;
}
Expand description

A convenient trait to TryInto, or else return the original object. It’s useful for implementing event handlers.

Required Methods§

source

fn try_into_or_self(self) -> Result<R, Self>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<R, T: TryInto<R, Error = T>> TryIntoOrSelf<R> for T