pub type Result<T = TokenStream, E = Error> = Result<T, E>;Expand description
An alias for Result suited for use with this crate
Aliased Type§
pub enum Result<T = TokenStream, E = Error> {
Ok(T),
Err(E),
}Variants§
Trait Implementations§
Source§impl<T: MacroOutput, E: ToTokensError + 'static> MacroOutput for Result<T, E>
impl<T: MacroOutput, E: ToTokensError + 'static> MacroOutput for Result<T, E>
Source§fn convert(self) -> Result<TokenStream, Error>
fn convert(self) -> Result<TokenStream, Error>
Handles conversion into a
Result<TokenStream, Error>.Source§impl<T, E: ToTokensError + 'static> ResultExt<T, E> for Result<T, E>
impl<T, E: ToTokensError + 'static> ResultExt<T, E> for Result<T, E>
Source§fn context_with<C: ToTokensError + 'static>(
self,
error: impl FnOnce() -> C,
) -> Result<T, Error>
fn context_with<C: ToTokensError + 'static>( self, error: impl FnOnce() -> C, ) -> Result<T, Error>
If self is error, attaches another error, closure is only executed if
the
Result is ErrSource§fn attachment(self, label: &'static str, msg: impl Display) -> Result<T, E>where
E: Attachment,
fn attachment(self, label: &'static str, msg: impl Display) -> Result<T, E>where
E: Attachment,
If self is error, extend error message Read more
Source§fn context(self, error: impl ToTokensError + 'static) -> Result<T, Error>
fn context(self, error: impl ToTokensError + 'static) -> Result<T, Error>
If self is error, attaches another error
Source§fn error(self, msg: impl Display) -> Selfwhere
E: Attachment,
fn error(self, msg: impl Display) -> Selfwhere
E: Attachment,
Attaches a new
error message to self reusing the same spanSource§fn warning(self, msg: impl Display) -> Selfwhere
E: Attachment,
fn warning(self, msg: impl Display) -> Selfwhere
E: Attachment,
Attaches a new
warning message to self reusing the same spanSource§fn note(self, msg: impl Display) -> Selfwhere
E: Attachment,
fn note(self, msg: impl Display) -> Selfwhere
E: Attachment,
Attaches a new
note message to self reusing the same spanSource§fn help(self, msg: impl Display) -> Selfwhere
E: Attachment,
fn help(self, msg: impl Display) -> Selfwhere
E: Attachment,
Attaches a new
help message to self reusing the same span