pub enum MacrosError {
Parse(ParseError),
User(Box<dyn Error + Send + Sync>),
}
Expand description
The error type for this crate. Can be either a Parse(ParseError)
from this crate or a User(Box<dyn Error + Send + Sync>)
user error.
Variants§
Implementations§
Source§impl MacrosError
impl MacrosError
Sourcepub fn into_diagnostic(self) -> Diagnostic
pub fn into_diagnostic(self) -> Diagnostic
Convert the error into a proc_macro_error::Diagnostic
.
Sourcepub fn unexpected_end_of_input(self, msg: &str) -> Self
pub fn unexpected_end_of_input(self, msg: &str) -> Self
Add a message to the error if it is a Self::Parse
and the error is an UnexpectedEndOfInput
.
Trait Implementations§
Source§impl Debug for MacrosError
impl Debug for MacrosError
Source§impl Display for MacrosError
impl Display for MacrosError
Source§impl Error for MacrosError
impl Error for MacrosError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ParseError> for MacrosError
impl From<ParseError> for MacrosError
Source§fn from(error: ParseError) -> Self
fn from(error: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MacrosError
impl !RefUnwindSafe for MacrosError
impl !Send for MacrosError
impl !Sync for MacrosError
impl Unpin for MacrosError
impl !UnwindSafe for MacrosError
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