pub struct Fn {
pub fn_token: Token,
pub name: String,
pub params: Vec<FnParam>,
pub body: Block,
pub public: bool,
pub return_type: Option<FunctionType>,
pub is_static: bool,
}Expand description
Represents a function declaration in the AST.
A function includes its name, parameters, body, export status, and an optional return type.
Fields§
§fn_token: TokenThe token representing the fn keyword.
name: StringThe name of the function.
params: Vec<FnParam>The list of parameters for the function.
body: BlockThe body of the function as a block of statements.
public: boolIndicates whether the function is public.
return_type: Option<FunctionType>An optional return type annotation.
is_static: boolIndicates whether the function is static.
Trait Implementations§
impl StructuralPartialEq for Fn
Auto Trait Implementations§
impl Freeze for Fn
impl RefUnwindSafe for Fn
impl Send for Fn
impl Sync for Fn
impl Unpin for Fn
impl UnwindSafe for Fn
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