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§
Source§impl From<ArgCaptured> for FnArg
impl From<ArgCaptured> for FnArg
Source§fn from(e: ArgCaptured) -> FnArg
fn from(e: ArgCaptured) -> FnArg
Converts to this type from the input type.
Source§impl From<ArgSelfRef> for FnArg
impl From<ArgSelfRef> for FnArg
Source§fn from(e: ArgSelfRef) -> FnArg
fn from(e: ArgSelfRef) -> FnArg
Converts to this type from the input type.
impl Eq for FnArg
impl StructuralPartialEq for FnArg
Auto Trait Implementations§
impl Freeze for FnArg
impl RefUnwindSafe for FnArg
impl !Send for FnArg
impl !Sync for FnArg
impl Unpin for FnArg
impl UnwindSafe for FnArg
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: ToTokens,
impl<T> Spanned for Twhere
T: ToTokens,
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.