#[non_exhaustive]pub struct ClosureExpr {
pub is_static: bool,
pub by_ref: bool,
pub params: Box<[Param]>,
pub use_vars: Box<[ClosureUseVar]>,
pub return_type: Option<TypeHint>,
pub body: Box<Block>,
pub attributes: Box<[Attribute]>,
}Expand description
An anonymous function.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.is_static: boolWhether declared static.
by_ref: boolWhether it returns by reference.
params: Box<[Param]>Parameters.
use_vars: Box<[ClosureUseVar]>Captured variables.
return_type: Option<TypeHint>Declared return type.
body: Box<Block>Function body.
attributes: Box<[Attribute]>Attributes on the closure.
Implementations§
Trait Implementations§
Source§impl Clone for ClosureExpr
impl Clone for ClosureExpr
Source§impl Debug for ClosureExpr
impl Debug for ClosureExpr
Auto Trait Implementations§
impl Freeze for ClosureExpr
impl RefUnwindSafe for ClosureExpr
impl Send for ClosureExpr
impl Sync for ClosureExpr
impl Unpin for ClosureExpr
impl UnsafeUnpin for ClosureExpr
impl UnwindSafe for ClosureExpr
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