pub struct Function {
pub name: String,
pub parameters: Vec<String>,
pub body: Option<Vec<u8>>,
pub native_function: Option<NativeFunction>,
pub closure: HashMap<String, Value>,
}Fields§
§name: String§parameters: Vec<String>§body: Option<Vec<u8>>§native_function: Option<NativeFunction>§closure: HashMap<String, Value>Implementations§
Source§impl Function
impl Function
pub fn new(name: String, parameters: Vec<String>) -> Self
pub fn native( name: String, parameters: Vec<String>, func: NativeFunction, ) -> Self
pub fn call( &self, context: &mut Context, arguments: &[Value], ) -> Result<Value, String>
pub fn set_closure_variable(&mut self, name: String, value: Value)
pub fn get_closure_variable(&self, name: &str) -> Option<&Value>
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