Skip to main content

rew_extensions/ext/
mod.rs

1#![allow(unused_variables)]
2#![allow(clippy::derivable_impls)]
3use deno_core::Extension;
4
5trait ExtensionTrait<A> {
6  fn init(options: A) -> Extension;
7
8  /// Makes a call to `init_ops_and_esm` equivalent to `init_ops`
9  fn set_esm(mut ext: Extension, is_snapshot: bool) -> Extension {
10    if is_snapshot {
11      ext.js_files = ::std::borrow::Cow::Borrowed(&[]);
12      ext.esm_files = ::std::borrow::Cow::Borrowed(&[]);
13      ext.esm_entry_point = ::std::option::Option::None;
14    }
15    ext
16  }
17
18  /// Builds an extension
19  fn build(options: A, is_snapshot: bool) -> Extension {
20    let ext = Self::init(options);
21    Self::set_esm(ext, is_snapshot)
22  }
23}
24
25pub mod console;
26pub mod ffi;
27pub mod url;
28pub mod web;
29pub mod webidl;
30
31pub mod fs;
32pub mod http;
33pub mod io;
34pub mod networking;
35pub mod os;
36pub mod process;
37pub mod telemetry;