[][src]Trait rustc_ap_rustc_target::abi::MaybeResult

pub trait MaybeResult<T> {
    type Error;
    fn from(x: Result<T, Self::Error>) -> Self;
fn to_result(self) -> Result<T, Self::Error>; }

The TyAndLayout above will always be a MaybeResult<TyAndLayout<'_, Self>>. We can't add the bound due to the lifetime, but this trait is still useful when writing code that's generic over the LayoutOf impl.

Associated Types

type Error

Loading content...

Required methods

fn from(x: Result<T, Self::Error>) -> Self

fn to_result(self) -> Result<T, Self::Error>

Loading content...

Implementations on Foreign Types

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

type Error = E

Loading content...

Implementors

impl<T> MaybeResult<T> for T[src]

type Error = !

Loading content...