Struct deno_core::ExtensionBuilder
source · pub struct ExtensionBuilder { /* private fields */ }
Implementations§
source§impl ExtensionBuilder
impl ExtensionBuilder
pub fn js(&mut self, js_files: Vec<ExtensionFileSource>) -> &mut Self
pub fn esm(&mut self, esm_files: Vec<ExtensionFileSource>) -> &mut Self
pub fn esm_entry_point(&mut self, entry_point: &'static str) -> &mut Self
pub fn ops(&mut self, ops: Vec<OpDecl>) -> &mut Self
pub fn state<F>(&mut self, opstate_fn: F) -> &mut Selfwhere F: FnOnce(&mut OpState) + 'static,
pub fn middleware<F>(&mut self, middleware_fn: F) -> &mut Selfwhere F: Fn(OpDecl) -> OpDecl + 'static,
pub fn event_loop_middleware<F>(&mut self, middleware_fn: F) -> &mut Selfwhere F: Fn(Rc<RefCell<OpState>>, &mut Context<'_>) -> bool + 'static,
sourcepub fn force_op_registration(&mut self) -> &mut Self
pub fn force_op_registration(&mut self) -> &mut Self
Mark that ops from this extension should be added to Deno.core.ops
unconditionally. This is useful is some ops are not available
during snapshotting, as ops are not registered by default when a
JsRuntime
is created with an existing snapshot.
sourcepub fn take(self) -> Extension
pub fn take(self) -> Extension
Consume the ExtensionBuilder
and return an Extension
.
pub fn build(&mut self) -> Extension
Trait Implementations§
source§impl Default for ExtensionBuilder
impl Default for ExtensionBuilder
source§fn default() -> ExtensionBuilder
fn default() -> ExtensionBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ExtensionBuilder
impl !Send for ExtensionBuilder
impl !Sync for ExtensionBuilder
impl Unpin for ExtensionBuilder
impl !UnwindSafe for ExtensionBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more