[−][src]Struct proc_macro_error::MultiMacroErrors
This type represents a container for multiple errors. Each error has it's own span location.
Methods
impl MultiMacroErrors
[src]
pub fn new() -> Self
[src]
Create an empty errors storage.
pub fn is_empty(&self) -> bool
[src]
Test if the storage contains no errors.
pub fn add(&mut self, err: MacroError)
[src]
Add an error to the list of errors.
pub fn add_span_msg(&mut self, span: Span, msg: String)
[src]
Shortcut for .add(MacroError::new(span, msg))
pub fn into_compile_errors(self) -> TokenStream
[src]
Convert this storage into TokenStream
consisting of compile_error!(msg1); compile_error!(msg2);
...
sequence. Each compile_error!
invocation gets the span attached to the particular message.
pub fn trigger(self) -> !
[src]
Abort the proc-macro's execution and display the errors contained.
Note:
This function aborts even no errors are present! It's very much possibly that
trigger_on_error
is what you really want.
pub fn trigger_on_error(self)
[src]
If this storage is not empty abort the proc-macro's execution and display the errors contained.
Trait Implementations
impl From<MultiMacroErrors> for TokenStream
[src]
fn from(errors: MultiMacroErrors) -> Self
[src]
impl From<MultiMacroErrors> for TokenStream
[src]
fn from(errors: MultiMacroErrors) -> Self
[src]
impl IntoIterator for MultiMacroErrors
[src]
type Item = MacroError
The type of the elements being iterated over.
type IntoIter = <Vec<MacroError> as IntoIterator>::IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl Deref for MultiMacroErrors
[src]
type Target = [MacroError]
The resulting type after dereferencing.
fn deref(&self) -> &[MacroError]
[src]
impl DerefMut for MultiMacroErrors
[src]
fn deref_mut(&mut self) -> &mut [MacroError]
[src]
impl FromIterator<MacroError> for MultiMacroErrors
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = MacroError>,
[src]
I: IntoIterator<Item = MacroError>,
Auto Trait Implementations
impl Unpin for MultiMacroErrors
impl !Send for MultiMacroErrors
impl !Sync for MultiMacroErrors
impl UnwindSafe for MultiMacroErrors
impl !RefUnwindSafe for MultiMacroErrors
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,