Struct neon::context::ModuleContext [−][src]
pub struct ModuleContext<'a> { /* fields omitted */ }
An execution context of module initialization.
Implementations
impl<'a> ModuleContext<'a>
[src]
impl<'a> ModuleContext<'a>
[src]pub fn export_function<T: Value>(
&mut self,
key: &str,
f: fn(_: FunctionContext<'_>) -> JsResult<'_, T>
) -> NeonResult<()>
[src]
&mut self,
key: &str,
f: fn(_: FunctionContext<'_>) -> JsResult<'_, T>
) -> NeonResult<()>
Convenience method for exporting a Neon function from a module.
pub fn export_value<T: Value>(
&mut self,
key: &str,
val: Handle<'_, T>
) -> NeonResult<()>
[src]
&mut self,
key: &str,
val: Handle<'_, T>
) -> NeonResult<()>
Exports a JavaScript value from a Neon module.
pub fn exports_object(&mut self) -> JsResult<'a, JsObject>
[src]
Produces a handle to a module’s exports object.
Trait Implementations
impl<'a> Context<'a> for ModuleContext<'a>
[src]
impl<'a> Context<'a> for ModuleContext<'a>
[src]fn lock(&self) -> Lock<'_>
[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]
V: Value,
&'c V: Borrow,
F: for<'b> FnOnce(Ref<'b, <&'c V as Borrow>::Target>) -> T,
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]
V: Value,
&'c mut V: BorrowMut,
F: for<'b> FnOnce(RefMut<'b, <&'c mut V as Borrow>::Target>) -> T,
fn execute_scoped<T, F>(&self, f: F) -> T where
F: for<'b> FnOnce(ExecuteContext<'b>) -> T,
[src]
F: for<'b> FnOnce(ExecuteContext<'b>) -> T,
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]
V: Value,
F: for<'b, 'c> FnOnce(ComputeContext<'b, 'c>) -> JsResult<'b, V>,
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 number<T: Into<f64>>(&mut self, x: T) -> Handle<'a, JsNumber>
[src]
fn string<S: AsRef<str>>(&mut self, s: S) -> Handle<'a, JsString>
[src]
fn try_string<S: AsRef<str>>(&mut self, s: S) -> StringResult<'a>
[src]
fn null(&mut self) -> Handle<'a, JsNull>
[src]
fn undefined(&mut self) -> Handle<'a, JsUndefined>
[src]
fn empty_object(&mut self) -> Handle<'a, JsObject>
[src]
fn empty_array(&mut self) -> Handle<'a, JsArray>
[src]
fn array_buffer(&mut self, size: u32) -> JsResult<'a, JsArrayBuffer>
[src]
fn buffer(&mut self, size: u32) -> JsResult<'a, JsBuffer>
[src]
fn date(
&mut self,
value: impl Into<f64>
) -> Result<Handle<'a, JsDate>, DateError>
[src]
&mut self,
value: impl Into<f64>
) -> Result<Handle<'a, JsDate>, DateError>
fn global(&mut self) -> Handle<'a, JsObject>
[src]
fn throw<T: Value, U>(&mut self, v: Handle<'_, T>) -> NeonResult<U>
[src]
fn 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]
fn range_error<S: AsRef<str>>(&mut self, msg: S) -> JsResult<'a, JsError>
[src]
fn throw_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]
fn throw_range_error<S: AsRef<str>, T>(&mut self, msg: S) -> NeonResult<T>
[src]
fn boxed<U: Finalize + Send + 'static>(&mut self, v: U) -> Handle<'a, JsBox<U>>
[src]
fn queue(&mut self) -> EventQueue
[src]
impl<'a> UnwindSafe for ModuleContext<'a>
[src]
impl<'a> UnwindSafe for ModuleContext<'a>
[src]Auto Trait Implementations
impl<'a> !RefUnwindSafe for ModuleContext<'a>
impl<'a> !RefUnwindSafe for ModuleContext<'a>
impl<'a> !Send for ModuleContext<'a>
impl<'a> !Send for ModuleContext<'a>
impl<'a> !Sync for ModuleContext<'a>
impl<'a> !Sync for ModuleContext<'a>
impl<'a> Unpin for ModuleContext<'a>
impl<'a> Unpin for ModuleContext<'a>