pub struct ExtensionBuilder { /* private fields */ }

Implementations§

source§

impl ExtensionBuilder

source

pub fn js(&mut self, js_files: Vec<ExtensionFileSource>) -> &mut Self

source

pub fn esm(&mut self, esm_files: Vec<ExtensionFileSource>) -> &mut Self

source

pub fn lazy_loaded_esm( &mut self, lazy_loaded_esm_files: Vec<ExtensionFileSource> ) -> &mut Self

source

pub fn esm_entry_point(&mut self, entry_point: &'static str) -> &mut Self

source

pub fn ops(&mut self, ops: Vec<OpDecl>) -> &mut Self

source

pub fn state<F>(&mut self, op_state_fn: F) -> &mut Self
where F: FnOnce(&mut OpState) + 'static,

source

pub fn middleware<F>(&mut self, middleware_fn: F) -> &mut Self
where F: Fn(OpDecl) -> OpDecl + 'static,

source

pub fn global_template_middleware<F>( &mut self, middleware_fn: for<'s> fn(_: &mut HandleScope<'s, ()>, _: Local<'s, ObjectTemplate>) -> Local<'s, ObjectTemplate> ) -> &mut Self

source

pub fn global_object_middleware<F>( &mut self, middleware_fn: for<'s> fn(_: &mut HandleScope<'s>, _: Local<'s, Object>) ) -> &mut Self

source

pub fn external_references( &mut self, external_references: Vec<ExternalReference<'static>> ) -> &mut Self

source

pub fn take(self) -> Extension

Consume the ExtensionBuilder and return an Extension.

source

pub fn build(&mut self) -> Extension

Trait Implementations§

source§

impl Default for ExtensionBuilder

source§

fn default() -> ExtensionBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.