pub enum Arg {
Flag(Ident),
Expr(Ident, Expr),
List(Ident, Args),
Lit(Lit),
}Variants§
Implementations§
Source§impl Arg
impl Arg
pub fn name(&self) -> Option<&Ident>
pub fn is_flag(&self) -> bool
pub fn is_expr(&self) -> bool
pub fn is_list(&self) -> bool
pub fn is_lit(&self) -> bool
pub fn as_expr(&self) -> &Expr
pub fn as_args(&self) -> &Args
pub fn as_lit(&self) -> &Lit
pub fn as_flag(&self) -> &Ident
pub fn as_str(&self) -> String
pub fn as_int<T: FromStr>(&self) -> T
pub fn as_float<T: FromStr>(&self) -> T
pub fn as_char(&self) -> char
pub fn as_expr_lit(&self) -> Option<&Lit>
pub fn as_bool(&self) -> bool
Trait Implementations§
Source§impl ToTokens for Arg
impl ToTokens for Arg
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 Freeze for Arg
impl RefUnwindSafe for Arg
impl !Send for Arg
impl !Sync for Arg
impl Unpin for Arg
impl UnsafeUnpin for Arg
impl UnwindSafe for Arg
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> 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.