Lines Matching refs:Meta

42     /// - Meta::Path — attributes whose information content conveys just a
45 /// - Meta::List — attributes that carry arbitrary tokens after the
49 /// - Meta::NameValue — attributes with an `=` sign after the path,
60 /// ^^^^^^^^^^^^^^^^^^^Meta::List
64 /// ^^^^^^^^^^^^^^^^^^^^^^^Meta::NameValue
67 /// ^^^^Meta::Path
117 /// `Meta::List` variety of attribute are held in an arbitrary `tokens:
169 pub meta: Meta,
184 /// This is similar to pulling out the `TokenStream` from `Meta::List` and
239 Meta::Path(path) => Err(crate::error::new2(
248 Meta::NameValue(meta) => Err(Error::new(
256 Meta::List(meta) => meta.parse_args_with(parser),
263 /// The [*Meta Item Attribute Syntax*][syntax] section in the Rust reference
347 /// use syn::{parenthesized, token, Error, LitInt, Meta, Token};
355 /// let nested = attr.parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)?;
359 /// Meta::Path(path) if path.is_ident("C") => {
364 /// Meta::List(meta) if meta.path.is_ident("align") => {
465 pub enum Meta {
496 impl Meta {
503 Meta::Path(path) => path,
504 Meta::List(meta) => &meta.path,
505 Meta::NameValue(meta) => &meta.path,
509 /// Error if this is a `Meta::List` or `Meta::NameValue`.
514 Meta::Path(path) => return Ok(path),
515 Meta::List(meta) => meta.delimiter.span().open(),
516 Meta::NameValue(meta) => meta.eq_token.span,
521 /// Error if this is a `Meta::Path` or `Meta::NameValue`.
526 Meta::List(meta) => Ok(meta),
527 Meta::Path(path) => Err(crate::error::new2(
535 Meta::NameValue(meta) => Err(Error::new(meta.eq_token.span, "expected `(`")),
539 /// Error if this is a `Meta::Path` or `Meta::List`.
544 Meta::NameValue(meta) => Ok(meta),
545 Meta::Path(path) => Err(crate::error::new2(
553 Meta::List(meta) => Err(Error::new(meta.delimiter.span().open(), "expected `=`")),
651 impl Parse for Meta {
674 pub(crate) fn parse_meta_after_path(path: Path, input: ParseStream) -> Result<Meta> {
676 parse_meta_list_after_path(path, input).map(Meta::List)
678 parse_meta_name_value_after_path(path, input).map(Meta::NameValue)
680 Ok(Meta::Path(path))