pub enum Meta {
Path(Path),
List(MetaList),
NameValue(MetaNameValue),
}Variants§
Implementations§
Trait Implementations§
Source§impl FromMeta for Meta
impl FromMeta for Meta
Source§fn from_meta(value: &Meta) -> Result<Self>
fn from_meta(value: &Meta) -> Result<Self>
Create an instance from a
syn::Meta by dispatching to the format-appropriate
trait function. This generally should not be overridden by implementers. Read morefn from_nested_meta(item: &NestedMeta) -> Result<Self>
Source§fn from_empty() -> Result<Self>
fn from_empty() -> Result<Self>
Create an instance from the presence of the word in the attribute with no
additional options specified.
Source§fn from_list(items: &[&NestedMeta]) -> Result<Self>
fn from_list(items: &[&NestedMeta]) -> Result<Self>
Create an instance from a list of nested meta items.
Source§fn from_value(value: &MetaValue) -> Result<Self>
fn from_value(value: &MetaValue) -> Result<Self>
Create an instance from a literal value of either
foo = "bar" or foo("bar").
This dispatches to the appropriate method based on the type of literal encountered,
and generally should not be overridden by implementers. Read morefn from_lit(lit: &Lit) -> Result<Self>
Source§fn from_char<S: Spanned>(value: char, span: &S) -> Result<Self>
fn from_char<S: Spanned>(value: char, span: &S) -> Result<Self>
Create an instance from a char literal in a value position.
Source§fn from_int<S: Spanned>(value: u64, span: &S) -> Result<Self>
fn from_int<S: Spanned>(value: u64, span: &S) -> Result<Self>
Create an instance from a int literal in a value position.
Source§fn from_path(value: &Path) -> Result<Self>
fn from_path(value: &Path) -> Result<Self>
Create an instance from a char literal in a value position.
Source§fn from_string<S: Spanned>(value: &str, span: &S) -> Result<Self>
fn from_string<S: Spanned>(value: &str, span: &S) -> Result<Self>
Create an instance from a string literal in a value position.
Source§fn from_bool<S: Spanned>(value: bool, span: &S) -> Result<Self>
fn from_bool<S: Spanned>(value: bool, span: &S) -> Result<Self>
Create an instance from a bool literal in a value position.
fn from_ident(value: &Ident) -> Result<Self>
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,
impl StructuralPartialEq for Meta
Auto Trait Implementations§
impl Freeze for Meta
impl RefUnwindSafe for Meta
impl !Send for Meta
impl !Sync for Meta
impl Unpin 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.