pub struct Func {
pub name_hint: Option<Ident>,
pub return_ty: Option<Ty>,
pub body: Box<Expr>,
pub params: Vec<FuncParam>,
pub named_params: Vec<FuncParam>,
pub generic_type_params: Vec<GenericTypeParam>,
pub args: Vec<Expr>,
pub env: HashMap<String, Expr>,
}
Expand description
Function called with possibly missing positional arguments. May also contain environment that is needed to evaluate the body.
Fields§
§name_hint: Option<Ident>
Name of the function. Used for user-facing messages only.
return_ty: Option<Ty>
Type requirement for the function body expression.
body: Box<Expr>
Expression containing parameter (and environment) references.
params: Vec<FuncParam>
Positional function parameters.
named_params: Vec<FuncParam>
Named function parameters.
generic_type_params: Vec<GenericTypeParam>
Generic type arguments within this function.
args: Vec<Expr>
Arguments that have already been provided.
env: HashMap<String, Expr>
Additional variables that the body of the function may need to be evaluated.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Func
impl<'de> Deserialize<'de> for Func
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Func
impl PartialEq for Func
impl StructuralPartialEq for Func
Auto Trait Implementations§
impl RefUnwindSafe for Func
impl Send for Func
impl Sync for Func
impl Unpin for Func
impl UnwindSafe for Func
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