pub struct Error(/* private fields */);Expand description
This crates Error type
Implementations§
Source§impl Error
impl Error
Sourcepub fn from(error: impl ToTokensError + 'static) -> Self
pub fn from(error: impl ToTokensError + 'static) -> Self
Mimics From<impl ToTokensError> for Error implementation to
not conflict std’s From<T> for T
Sourcepub fn push(&mut self, error: impl ToTokensError + 'static)
pub fn push(&mut self, error: impl ToTokensError + 'static)
Pushes an additional Error
Alternatively errors can also be “added”:
use manyhow::{Error, error_message};
let mut error = Error::from(error_message!("Hello Rust!"));
error += error_message!("Hello 🦀!");Trait Implementations§
Source§impl<T: ToTokensError + 'static> Add<T> for Error
impl<T: ToTokensError + 'static> Add<T> for Error
Source§impl<T: ToTokensError + 'static> AddAssign<T> for Error
impl<T: ToTokensError + 'static> AddAssign<T> for Error
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+= operation. Read moreSource§impl<I: ToTokensError + 'static> Extend<I> for Error
impl<I: ToTokensError + 'static> Extend<I> for Error
Source§fn extend<T: IntoIterator<Item = I>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = I>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl From<Error> for Error
Available on crate feature darling only.
impl From<Error> for Error
Available on crate feature
darling only.Source§fn from(error: DarlingError) -> Self
fn from(error: DarlingError) -> Self
Converts to this type from the input type.
Source§impl From<ErrorMessage> for Error
impl From<ErrorMessage> for Error
Source§fn from(error: ErrorMessage) -> Self
fn from(error: ErrorMessage) -> Self
Converts to this type from the input type.
Source§impl From<SilentError> for Error
impl From<SilentError> for Error
Source§fn from(_: SilentError) -> Self
fn from(_: SilentError) -> Self
Converts to this type from the input type.
Source§impl ToTokensError for Error
impl ToTokensError for Error
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Equivalent to
ToTokens::to_tokensSource§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Equivalent to
ToTokens::to_token_streamSource§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Equivalent to
ToTokens::into_token_streamAuto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl !Send for Error
impl !Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more