pub struct Meta {
pub path: Path,
pub args: Option<TokenStream>,
}Expand description
One META element: path or path(args).
Fields§
§path: Pathpath of path(args).
args: Option<TokenStream>The tokens inside the parentheses, if any.
Implementations§
Source§impl Meta
impl Meta
Sourcepub fn parse_args_with<P: Parser>(&self, parser: P) -> Result<P::Output>
pub fn parse_args_with<P: Parser>(&self, parser: P) -> Result<P::Output>
Parses the args with parser.
Sourcepub fn name_values(&self) -> Result<Vec<MetaNameValue>>
pub fn name_values(&self) -> Result<Vec<MetaNameValue>>
The args as key = value pairs. Values must be expressions; use
kv for types and lists.
Trait Implementations§
Source§impl ToTokens for Meta
impl ToTokens for Meta
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &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 !Send for Meta
impl !Sync for Meta
impl Freeze for Meta
impl RefUnwindSafe for Meta
impl Unpin for Meta
impl UnsafeUnpin for Meta
impl UnwindSafe for Meta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.