pub struct deno_kv {}
Expand description
An extension for use with the Deno JS runtime. To use it, provide it as an argument when instantiating your runtime:
use deno_core::{ JsRuntime, RuntimeOptions };
let mut extensions = vec![deno_kv::init_ops_and_esm()];
let mut js_runtime = JsRuntime::new(RuntimeOptions {
extensions,
..Default::default()
});
Implementations§
source§impl deno_kv
impl deno_kv
sourcepub fn init_js_only<DBH: DatabaseHandler + 'static>() -> Extension
👎Deprecated since 0.216.0: please use init_ops_and_esm
or init_ops
instead
pub fn init_js_only<DBH: DatabaseHandler + 'static>() -> Extension
init_ops_and_esm
or init_ops
insteadLegacy function for extension instantiation.
Please use init_ops_and_esm
or init_ops
instead
Returns
an Extension object that can be used during instantiation of a JsRuntime
sourcepub fn init_ops_and_esm<DBH: DatabaseHandler + 'static>(
handler: DBH,
unstable: bool
) -> Extension
pub fn init_ops_and_esm<DBH: DatabaseHandler + 'static>( handler: DBH, unstable: bool ) -> Extension
Initialize this extension for runtime or snapshot creation. Use this
function if the runtime or snapshot is not created from a (separate)
snapshot, or that snapshot does not contain this extension. Otherwise
use init_ops()
instead.
Returns
an Extension object that can be used during instantiation of a JsRuntime
sourcepub fn init_ops<DBH: DatabaseHandler + 'static>(
handler: DBH,
unstable: bool
) -> Extension
pub fn init_ops<DBH: DatabaseHandler + 'static>( handler: DBH, unstable: bool ) -> Extension
Initialize this extension for runtime or snapshot creation, excluding its JavaScript sources and evaluation. This is used when the runtime or snapshot is created from a (separate) snapshot which includes this extension in order to avoid evaluating the JavaScript twice.
Returns
an Extension object that can be used during instantiation of a JsRuntime