[−][src]Struct macro_compose::Context
used to lint, expand and capture
a context might not have data in it (eg. if parsing the data failed), so calling the lint and expand functions does not guarantee the Lint
s and Expand
s actually run
Implementations
impl<'a, T> Context<'a, T>
[src]
pub fn new(collector: &'a mut Collector, data: T) -> Self
[src]
create a new context with the data
pub fn new_by_ref(collector: &'a mut Collector, data: &'a T) -> Self
[src]
create a new context with the data passed by reference
pub fn new_empty(collector: &'a mut Collector) -> Self
[src]
create a new context without any data in it
pub fn new_parse(collector: &'a mut Collector, data: TokenStream) -> Self where
T: Parse,
[src]
T: Parse,
try to parse the data from a proc_macro::TokenStream
if parsing the data fails the error is reported to the collector
pub fn new_parse2(collector: &'a mut Collector, data: TokenStream) -> Self where
T: Parse,
[src]
T: Parse,
try to parse the data from a proc_macro2::TokenStream
if parsing the data fails the error is reported to the collector
pub fn lint<L: Lint<T>>(&mut self, lint: &L) -> bool
[src]
lint the macro input
returns true if the lint ran without reporting an error
pub fn expand(&mut self, expand: &impl Expand<T>)
[src]
expand the macro and add the result to the collector
pub fn capture<E: Expand<T>>(&mut self, expand: &E) -> Option<E::Output>
[src]
expand the macro and return the output
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for Context<'a, T>
impl<'a, T> !Send for Context<'a, T>
impl<'a, T> !Sync for Context<'a, T>
impl<'a, T> Unpin for Context<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> !UnwindSafe for Context<'a, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,