Skip to main content

EnvironmentRecord

Trait EnvironmentRecord 

Source
pub trait EnvironmentRecord {
    // Required methods
    fn has_binding(&self, name: &String) -> bool;
    fn create_mutable_binding(
        &mut self,
        name: String,
        can_delete: bool,
    ) -> Result<(), JErrorType>;
    fn create_immutable_binding(
        &mut self,
        name: String,
    ) -> Result<(), JErrorType>;
    fn initialize_binding(
        &mut self,
        ctx_stack: &mut ExecutionContextStack,
        name: String,
        value: JsValue,
    ) -> Result<bool, JErrorType>;
    fn set_mutable_binding(
        &mut self,
        ctx_stack: &mut ExecutionContextStack,
        name: String,
        value: JsValue,
    ) -> Result<(), JErrorType>;
    fn get_binding_value(
        &self,
        ctx_stack: &mut ExecutionContextStack,
        name: &String,
    ) -> Result<JsValue, JErrorType>;
    fn delete_binding(&mut self, name: &String) -> Result<bool, JErrorType>;
    fn has_this_binding(&self) -> bool;
    fn has_super_binding(&self) -> bool;

    // Provided method
    fn get_all_bindings(&self) -> Option<Vec<(String, JsValue)>> { ... }
}

Required Methods§

Source

fn has_binding(&self, name: &String) -> bool

Source

fn create_mutable_binding( &mut self, name: String, can_delete: bool, ) -> Result<(), JErrorType>

Source

fn create_immutable_binding(&mut self, name: String) -> Result<(), JErrorType>

Source

fn initialize_binding( &mut self, ctx_stack: &mut ExecutionContextStack, name: String, value: JsValue, ) -> Result<bool, JErrorType>

Source

fn set_mutable_binding( &mut self, ctx_stack: &mut ExecutionContextStack, name: String, value: JsValue, ) -> Result<(), JErrorType>

Source

fn get_binding_value( &self, ctx_stack: &mut ExecutionContextStack, name: &String, ) -> Result<JsValue, JErrorType>

Source

fn delete_binding(&mut self, name: &String) -> Result<bool, JErrorType>

Source

fn has_this_binding(&self) -> bool

Source

fn has_super_binding(&self) -> bool

Provided Methods§

Source

fn get_all_bindings(&self) -> Option<Vec<(String, JsValue)>>

Get all bindings as a vector of (name, value) pairs. Used for generators.

Implementors§