Trait ContextExt

Source
pub trait ContextExt: 'static {
Show 14 methods // Required methods fn check_syntax( &self, code: &str, mode: CheckSyntaxMode, uri: &str, line_number: u32, ) -> (CheckSyntaxResult, Exception); fn clear_exception(&self); fn evaluate(&self, code: &str) -> Option<Value>; fn evaluate_with_source_uri( &self, code: &str, uri: &str, line_number: u32, ) -> Option<Value>; fn exception(&self) -> Option<Exception>; fn global_object(&self) -> Option<Value>; fn value(&self, name: &str) -> Option<Value>; fn virtual_machine(&self) -> Option<VirtualMachine>; fn pop_exception_handler(&self); fn push_exception_handler<P: Fn(&Context, &Exception) + 'static>( &self, handler: P, ); fn set_value(&self, name: &str, value: &impl IsA<Value>); fn throw(&self, error_message: &str); fn throw_exception(&self, exception: &impl IsA<Exception>); fn throw_with_name(&self, error_name: &str, error_message: &str);
}

Required Methods§

Source

fn check_syntax( &self, code: &str, mode: CheckSyntaxMode, uri: &str, line_number: u32, ) -> (CheckSyntaxResult, Exception)

Source

fn clear_exception(&self)

Source

fn evaluate(&self, code: &str) -> Option<Value>

Source

fn evaluate_with_source_uri( &self, code: &str, uri: &str, line_number: u32, ) -> Option<Value>

Source

fn exception(&self) -> Option<Exception>

Source

fn global_object(&self) -> Option<Value>

Source

fn value(&self, name: &str) -> Option<Value>

Source

fn virtual_machine(&self) -> Option<VirtualMachine>

Source

fn pop_exception_handler(&self)

Source

fn push_exception_handler<P: Fn(&Context, &Exception) + 'static>( &self, handler: P, )

Source

fn set_value(&self, name: &str, value: &impl IsA<Value>)

Source

fn throw(&self, error_message: &str)

Source

fn throw_exception(&self, exception: &impl IsA<Exception>)

Source

fn throw_with_name(&self, error_name: &str, error_message: &str)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§