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

pub trait MaybeResult<T> {
    type Error;
    pub fn from(x: Result<T, Self::Error>) -> Self;
pub 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

Loading content...

Required methods

pub fn from(x: Result<T, Self::Error>) -> Self[src]

pub fn to_result(self) -> Result<T, Self::Error>[src]

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...