[][src]Struct neon::context::ModuleContext

pub struct ModuleContext<'a> { /* fields omitted */ }

A view of the JS engine in the context of top-level initialization of a Neon module.

Implementations

impl<'a> ModuleContext<'a>[src]

pub fn export_function<T: Value>(
    &mut self,
    key: &str,
    f: fn(_: FunctionContext<'_>) -> JsResult<'_, T>
) -> NeonResult<()>
[src]

Convenience method for exporting a Neon function from a module.

pub fn export_class<T: Class>(&mut self, key: &str) -> NeonResult<()>[src]

Convenience method for exporting a Neon class constructor from a module.

pub fn export_value<T: Value>(
    &mut self,
    key: &str,
    val: Handle<'_, T>
) -> NeonResult<()>
[src]

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> UnwindSafe for ModuleContext<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for ModuleContext<'a>

impl<'a> !Send for ModuleContext<'a>

impl<'a> !Sync for ModuleContext<'a>

impl<'a> Unpin for ModuleContext<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.