Struct neon::context::ExecuteContext [−][src]
pub struct ExecuteContext<'a> { /* fields omitted */ }
Expand description
An execution context of a scope created by Context::execute_scoped()
.
Trait Implementations
impl<'a> Context<'a> for ExecuteContext<'a>
[src]
impl<'a> Context<'a> for ExecuteContext<'a>
[src]fn lock(&self) -> Lock<'_>
[src]
fn lock(&self) -> Lock<'_>
[src]Lock the JavaScript engine, returning an RAII guard that keeps the lock active as long as the guard is alive. Read more
fn borrow<'c, V, T, F>(&self, v: &'c Handle<'_, V>, f: F) -> T where
V: Value,
&'c V: Borrow,
F: for<'b> FnOnce(Ref<'b, <&'c V as Borrow>::Target>) -> T,
[src]
fn borrow<'c, V, T, F>(&self, v: &'c Handle<'_, V>, f: F) -> T where
V: Value,
&'c V: Borrow,
F: for<'b> FnOnce(Ref<'b, <&'c V as Borrow>::Target>) -> T,
[src]Convenience method for locking the JavaScript engine and borrowing a single JS value’s internals. Read more
fn borrow_mut<'c, V, T, F>(&self, v: &'c mut Handle<'_, V>, f: F) -> T where
V: Value,
&'c mut V: BorrowMut,
F: for<'b> FnOnce(RefMut<'b, <&'c mut V as Borrow>::Target>) -> T,
[src]
fn borrow_mut<'c, V, T, F>(&self, v: &'c mut Handle<'_, V>, f: F) -> T where
V: Value,
&'c mut V: BorrowMut,
F: for<'b> FnOnce(RefMut<'b, <&'c mut V as Borrow>::Target>) -> T,
[src]Convenience method for locking the JavaScript engine and mutably borrowing a single JS value’s internals. Read more
fn execute_scoped<T, F>(&self, f: F) -> T where
F: for<'b> FnOnce(ExecuteContext<'b>) -> T,
[src]
fn execute_scoped<T, F>(&self, f: F) -> T where
F: for<'b> FnOnce(ExecuteContext<'b>) -> T,
[src]Executes a computation in a new memory management scope. Read more
fn compute_scoped<V, F>(&self, f: F) -> JsResult<'a, V> where
V: Value,
F: for<'b, 'c> FnOnce(ComputeContext<'b, 'c>) -> JsResult<'b, V>,
[src]
fn compute_scoped<V, F>(&self, f: F) -> JsResult<'a, V> where
V: Value,
F: for<'b, 'c> FnOnce(ComputeContext<'b, 'c>) -> JsResult<'b, V>,
[src]Executes a computation in a new memory management scope and computes a single result value that outlives the computation. Read more
fn try_catch<T, F>(&mut self, f: F) -> Result<T, Handle<'a, JsValue>> where
F: FnOnce(&mut Self) -> NeonResult<T>,
[src]
F: FnOnce(&mut Self) -> NeonResult<T>,
fn boolean(&mut self, b: bool) -> Handle<'a, JsBoolean>
[src]
fn boolean(&mut self, b: bool) -> Handle<'a, JsBoolean>
[src]Convenience method for creating a JsBoolean
value.
fn number<T: Into<f64>>(&mut self, x: T) -> Handle<'a, JsNumber>
[src]
fn number<T: Into<f64>>(&mut self, x: T) -> Handle<'a, JsNumber>
[src]Convenience method for creating a JsNumber
value.
fn string<S: AsRef<str>>(&mut self, s: S) -> Handle<'a, JsString>
[src]
fn string<S: AsRef<str>>(&mut self, s: S) -> Handle<'a, JsString>
[src]Convenience method for creating a JsString
value. Read more
fn try_string<S: AsRef<str>>(&mut self, s: S) -> StringResult<'a>
[src]
fn try_string<S: AsRef<str>>(&mut self, s: S) -> StringResult<'a>
[src]Convenience method for creating a JsString
value. Read more
fn undefined(&mut self) -> Handle<'a, JsUndefined>
[src]
fn undefined(&mut self) -> Handle<'a, JsUndefined>
[src]Convenience method for creating a JsUndefined
value.
fn empty_object(&mut self) -> Handle<'a, JsObject>
[src]
fn empty_object(&mut self) -> Handle<'a, JsObject>
[src]Convenience method for creating an empty JsObject
value.
fn empty_array(&mut self) -> Handle<'a, JsArray>
[src]
fn empty_array(&mut self) -> Handle<'a, JsArray>
[src]Convenience method for creating an empty JsArray
value.
fn array_buffer(&mut self, size: u32) -> JsResult<'a, JsArrayBuffer>
[src]
fn array_buffer(&mut self, size: u32) -> JsResult<'a, JsArrayBuffer>
[src]Convenience method for creating an empty JsArrayBuffer
value.
fn buffer(&mut self, size: u32) -> JsResult<'a, JsBuffer>
[src]
fn buffer(&mut self, size: u32) -> JsResult<'a, JsBuffer>
[src]Convenience method for creating an empty JsBuffer
value.
fn throw<T: Value, U>(&mut self, v: Handle<'_, T>) -> NeonResult<U>
[src]
fn throw<T: Value, U>(&mut self, v: Handle<'_, T>) -> NeonResult<U>
[src]Throws a JS value.
fn error<S: AsRef<str>>(&mut self, msg: S) -> JsResult<'a, JsError>
[src]
fn error<S: AsRef<str>>(&mut self, msg: S) -> JsResult<'a, JsError>
[src]Creates a direct instance of the Error
class.
fn type_error<S: AsRef<str>>(&mut self, msg: S) -> JsResult<'a, JsError>
[src]
fn type_error<S: AsRef<str>>(&mut self, msg: S) -> JsResult<'a, JsError>
[src]Creates an instance of the TypeError
class.
fn range_error<S: AsRef<str>>(&mut self, msg: S) -> JsResult<'a, JsError>
[src]
fn range_error<S: AsRef<str>>(&mut self, msg: S) -> JsResult<'a, JsError>
[src]Creates an instance of the RangeError
class.
fn throw_error<S: AsRef<str>, T>(&mut self, msg: S) -> NeonResult<T>
[src]
fn throw_error<S: AsRef<str>, T>(&mut self, msg: S) -> NeonResult<T>
[src]Throws a direct instance of the Error
class.
fn throw_type_error<S: AsRef<str>, T>(&mut self, msg: S) -> NeonResult<T>
[src]
fn throw_type_error<S: AsRef<str>, T>(&mut self, msg: S) -> NeonResult<T>
[src]Throws an instance of the TypeError
class.
fn throw_range_error<S: AsRef<str>, T>(&mut self, msg: S) -> NeonResult<T>
[src]
fn throw_range_error<S: AsRef<str>, T>(&mut self, msg: S) -> NeonResult<T>
[src]Throws an instance of the RangeError
class.