Struct ExprClosure
pub struct ExprClosure { pub attrs: Vec<Attribute>, pub lifetimes: Option<BoundLifetimes>, pub modifiers: ClosureModifiers, pub constness: Option<Const>, pub asyncness: Option<Async>, pub capture: Option<Move>, pub inputs_begin: Or, pub inputs: Punctuated<Pat, Comma>, pub inputs_end: Or, pub output: ReturnType, pub body: Box<Expr> }
A closure expression: |a, b| a + b.
Fields
attrs: Vec<Attribute>lifetimes: Option<BoundLifetimes>modifiers: ClosureModifiers(Non-exhaustive) Additional optional information about a closure.
constness: Option<Const>asyncness: Option<Async>capture: Option<Move>inputs_begin: Orinputs: Punctuated<Pat, Comma>inputs_end: Oroutput: ReturnTypebody: Box<Expr>
Trait Implementations
impl Clone for ExprClosure
fn clone(&self) -> Self
impl Parse for ExprClosure
fn parse(input: ParseStream<'_>) -> Result<Self>
impl ToTokens for ExprClosure
fn to_tokens(&self, tokens: &mut TokenStream)
Auto Trait Implementations
impl !Send for ExprClosure
impl !Sync for ExprClosure
impl Freeze for ExprClosure
impl RefUnwindSafe for ExprClosure
impl Unpin for ExprClosure
impl UnsafeUnpin for ExprClosure
impl UnwindSafe for ExprClosure
Blanket Implementations
impl<T> Any for ExprClosure
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ExprClosure
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ExprClosure
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for ExprClosure
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for ExprClosure
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Spanned for ExprClosure
where
T: Spanned + ?Sized,
fn span(&self) -> Span
impl<T> ToOwned for ExprClosure
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for ExprClosure
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for ExprClosure
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for ExprClosure
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>