pub struct EFuncContext<'a>(/* private fields */);
Implementations§
Source§impl<'a> EFuncContext<'a>
impl<'a> EFuncContext<'a>
Sourcepub fn push_to_array(&mut self) -> Result<(), EFuncError>
pub fn push_to_array(&mut self) -> Result<(), EFuncError>
Pops a value from the stack and pushes it to the array at the top of the stack
Sourcepub fn set_object_property(&mut self, prop: &str) -> Result<(), EFuncError>
pub fn set_object_property(&mut self, prop: &str) -> Result<(), EFuncError>
Pops a value from the stack and sets the property prop for the object instance at the top of the stack as the popped value
Sourcepub fn as_int(&mut self) -> Result<i32, EFuncError>
pub fn as_int(&mut self) -> Result<i32, EFuncError>
Pops an int from the stack
Sourcepub fn as_float(&mut self) -> Result<f64, EFuncError>
pub fn as_float(&mut self) -> Result<f64, EFuncError>
Pops a float from the stack
Sourcepub fn as_bool(&mut self) -> Result<bool, EFuncError>
pub fn as_bool(&mut self) -> Result<bool, EFuncError>
Pops a bool from the stack
Sourcepub fn is_null(&mut self) -> Result<bool, EFuncError>
pub fn is_null(&mut self) -> Result<bool, EFuncError>
Pops a value from the stack and checks if it is null
Sourcepub fn as_string(&mut self) -> Result<&str, EFuncError>
pub fn as_string(&mut self) -> Result<&str, EFuncError>
Pops a string from the top of the stack
Sourcepub fn as_symbol(&mut self) -> Result<&str, EFuncError>
pub fn as_symbol(&mut self) -> Result<&str, EFuncError>
Pops a symbol from the top of the stack
Sourcepub fn array_length(&mut self) -> Result<usize, EFuncError>
pub fn array_length(&mut self) -> Result<usize, EFuncError>
Gets the length of the array at the top of the stack
Sourcepub fn get_element(&mut self, index: usize) -> Result<(), EFuncError>
pub fn get_element(&mut self, index: usize) -> Result<(), EFuncError>
Pushes the value at index
of the array at the top of the stack
Sourcepub fn get_property(&mut self, prop: &str) -> Result<(), EFuncError>
pub fn get_property(&mut self, prop: &str) -> Result<(), EFuncError>
Pushes the value of property prop of the object at the top of the stack
Sourcepub fn pop(&mut self) -> Result<(), EFuncError>
pub fn pop(&mut self) -> Result<(), EFuncError>
Pops the top of the stack
Sourcepub fn insert_in_map(&mut self) -> Result<(), EFuncError>
pub fn insert_in_map(&mut self) -> Result<(), EFuncError>
Pops the value and then key from the stack and inserts it in the map at the top of the stack
Sourcepub fn error(
&mut self,
module: &str,
error_class: &str,
message: &str,
) -> Result<(), EFuncError>
pub fn error( &mut self, module: &str, error_class: &str, message: &str, ) -> Result<(), EFuncError>
Pushes an error with class error_class
within module module
and with message message