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§
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)
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.