summaryrefslogtreecommitdiff
path: root/core/extensions.rs
diff options
context:
space:
mode:
authorElias Sjögreen <eliassjogreen1@gmail.com>2021-05-07 15:45:07 +0200
committerGitHub <noreply@github.com>2021-05-07 09:45:07 -0400
commit4ed1428c3401c9e6dc4d737bd7c9a50840054696 (patch)
tree62888871bee247f35d0f663b784ab072becfc164 /core/extensions.rs
parentc709f5df363887647915f7dd67e1c3bb8df6c526 (diff)
fix: align plugin api with Extension (#10427)
Diffstat (limited to 'core/extensions.rs')
-rw-r--r--core/extensions.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/extensions.rs b/core/extensions.rs
index 9ad2b3697..e38d11fc9 100644
--- a/core/extensions.rs
+++ b/core/extensions.rs
@@ -24,7 +24,7 @@ impl Extension {
/// returns JS source code to be loaded into the isolate (either at snapshotting,
/// or at startup). as a vector of a tuple of the file name, and the source code.
- pub(crate) fn init_js(&self) -> Vec<SourcePair> {
+ pub fn init_js(&self) -> Vec<SourcePair> {
match &self.js_files {
Some(files) => files.clone(),
None => vec![],
@@ -32,7 +32,7 @@ impl Extension {
}
/// Called at JsRuntime startup to initialize ops in the isolate.
- pub(crate) fn init_ops(&mut self) -> Option<Vec<OpPair>> {
+ pub fn init_ops(&mut self) -> Option<Vec<OpPair>> {
// TODO(@AaronO): maybe make op registration idempotent
if self.initialized {
panic!("init_ops called twice: not idempotent or correct");
@@ -43,7 +43,7 @@ impl Extension {
}
/// Allows setting up the initial op-state of an isolate at startup.
- pub(crate) fn init_state(&self, state: &mut OpState) -> Result<(), AnyError> {
+ pub fn init_state(&self, state: &mut OpState) -> Result<(), AnyError> {
match &self.opstate_fn {
Some(ofn) => ofn(state),
None => Ok(()),
@@ -51,7 +51,7 @@ impl Extension {
}
/// init_middleware lets us middleware op registrations, it's called before init_ops
- pub(crate) fn init_middleware(&mut self) -> Option<Box<OpMiddlewareFn>> {
+ pub fn init_middleware(&mut self) -> Option<Box<OpMiddlewareFn>> {
self.middleware_fn.take()
}
}