pub enum FnArg {
SelfRef(ArgSelfRef),
SelfValue(ArgSelf),
Captured(ArgCaptured),
Inferred(Pat),
Ignored(Type),
}
Expand description
An argument in a function signature: the n: usize
in fn f(n: usize)
.
This type is available if Syn is built with the "full"
feature.
Syntax tree enum
This type is a syntax tree enum.
Variants
SelfRef(ArgSelfRef)
Self captured by reference in a function signature: &self
or &mut self
.
This type is available if Syn is built with the "full"
feature.
SelfValue(ArgSelf)
Self captured by value in a function signature: self
or mut self
.
This type is available if Syn is built with the "full"
feature.
Captured(ArgCaptured)
An explicitly typed pattern captured by a function signature.
This type is available if Syn is built with the "full"
feature.
Inferred(Pat)
A pattern whose type is inferred captured by a function signature.
Ignored(Type)
A type not bound to any pattern in a function signature.
Trait Implementations
sourceimpl From<ArgCaptured> for FnArg
impl From<ArgCaptured> for FnArg
sourcefn from(e: ArgCaptured) -> FnArg
fn from(e: ArgCaptured) -> FnArg
Converts to this type from the input type.
sourceimpl From<ArgSelfRef> for FnArg
impl From<ArgSelfRef> for FnArg
sourcefn from(e: ArgSelfRef) -> FnArg
fn from(e: ArgSelfRef) -> FnArg
Converts to this type from the input type.
sourceimpl ToTokens for FnArg
impl ToTokens for FnArg
sourcefn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
sourcefn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Eq for FnArg
impl StructuralEq for FnArg
impl StructuralPartialEq for FnArg
Auto Trait Implementations
impl RefUnwindSafe for FnArg
impl !Send for FnArg
impl !Sync for FnArg
impl Unpin for FnArg
impl UnwindSafe for FnArg
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Spanned for Twhere
T: ToTokens,
impl<T> Spanned for Twhere
T: ToTokens,
sourcefn 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. Read more