pub struct Function {
pub program: Program,
/* private fields */
}Expand description
function struct contain the program the code will run in the code the progarm will run and the arguments the function nead to get
Fields§
§program: ProgramImplementations§
Source§impl Function
impl Function
Sourcepub fn run(
&mut self,
args: Vec<Data>,
root: &Program,
) -> Result<Option<Vec<Token>>>
pub fn run( &mut self, args: Vec<Data>, root: &Program, ) -> Result<Option<Vec<Token>>>
run the function in normal mode
Sourcepub fn run_contractor(
&mut self,
args: Vec<Data>,
root: &Program,
class: String,
) -> Result<Option<Vec<Token>>>
pub fn run_contractor( &mut self, args: Vec<Data>, root: &Program, class: String, ) -> Result<Option<Vec<Token>>>
runs the function as a constractor that return an object represented as tokens
Sourcepub fn method_run(
&mut self,
args: Vec<Data>,
root: &mut Program,
instance: Vec<Token>,
) -> Result<Option<Vec<Token>>>
pub fn method_run( &mut self, args: Vec<Data>, root: &mut Program, instance: Vec<Token>, ) -> Result<Option<Vec<Token>>>
runs the functions as a menthod that change the value of the instance that it gets
pub fn new(code: Vec<Vec<Token>>, args_expected: Vec<String>) -> Function
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin 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