Enum devise_core::MetaItem
source · pub enum MetaItem {
Path(Path),
Tokens(TokenStream),
KeyValue {
path: Path,
eq: Eq,
tokens: TokenStream,
},
List {
path: Path,
delimiter: MacroDelimiter,
items: Punctuated<MetaItem, Comma>,
},
}
Variants§
Implementations§
source§impl MetaItem
impl MetaItem
pub fn attr_path(&self) -> Option<&Path>
pub fn name(&self) -> Option<&Ident>
pub fn tokens(&self) -> Option<&TokenStream>
pub fn parse_value<T: Parse>(&self, expected: &str) -> Result<T>
pub fn parse_value_with<P: Parser>( &self, parser: P, expected: &str ) -> Result<P::Output>
pub fn expected(&self, k: &str) -> Diagnostic
pub fn description(&self) -> &'static str
pub fn is_bare(&self) -> bool
pub fn expr(&self) -> Result<Expr>
pub fn path(&self) -> Result<Path>
pub fn lit(&self) -> Result<Lit>
pub fn list(&self) -> Result<impl Iterator<Item = &MetaItem> + Clone>
pub fn value_span(&self) -> Span
Trait Implementations§
source§impl ToTokens for MetaItem
impl ToTokens for MetaItem
source§fn to_tokens(&self, stream: &mut TokenStream)
fn to_tokens(&self, stream: &mut TokenStream)
source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere Self: Sized,
Auto Trait Implementations§
impl RefUnwindSafe for MetaItem
impl !Send for MetaItem
impl !Sync for MetaItem
impl Unpin for MetaItem
impl UnwindSafe for MetaItem
Blanket Implementations§
source§impl<T> AstItemExt for Twhere
T: ToTokens,
impl<T> AstItemExt for Twhere T: ToTokens,
fn respanned(&self, span: Span) -> Twhere T: Parse,
fn respanned_tokens(&self, span: Span) -> TokenStream
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
source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere T: Spanned + ?Sized,
source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.