pub struct Function {
pub ident: String,
pub params: Vec<Parameter>,
pub body: Vec<StatementNode>,
pub docs: Option<String>,
pub return_type: VarType,
}Expand description
A function statement, the basis for the whole language.
§Syntax example
fun number_adder(first_num: int, second_num: int) -> int {
--snip--
}Fields§
§ident: StringFunction identifier.
params: Vec<Parameter>Parameters declared inside of the function signature.
body: Vec<StatementNode>The main body inside of the function.
docs: Option<String>A markdown-compatible String that is a documenation comment.
NOTE: This may be bound to a trait in the future to extend to other datatypes.
return_type: VarTypeExpected return type inside of the function signature.
Trait Implementations§
impl StructuralPartialEq for Function
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
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