From 6e5f3453f806d6007b8f724837b5dd7d9eb17be9 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 20 Apr 2020 10:27:15 -0400 Subject: Remove core/plugin.rs (#4824) This simplifies the plugin interface in order to deliver op crates with a similar API --- core/plugins.rs | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 core/plugins.rs (limited to 'core/plugins.rs') diff --git a/core/plugins.rs b/core/plugins.rs deleted file mode 100644 index a423790bc..000000000 --- a/core/plugins.rs +++ /dev/null @@ -1,24 +0,0 @@ -// TODO(ry) This plugin module is superfluous. Try to remove definitions for -// "init_fn!", "PluginInitFn", and "PluginInitContext". - -use crate::ops::OpDispatcher; - -pub type PluginInitFn = fn(context: &mut dyn PluginInitContext); - -pub trait PluginInitContext { - fn register_op( - &mut self, - name: &str, - op: Box, // TODO(ry) rename to dispatcher, not op. - ); -} - -#[macro_export] -macro_rules! init_fn { - ($fn:path) => { - #[no_mangle] - pub fn deno_plugin_init(context: &mut dyn PluginInitContext) { - $fn(context) - } - }; -} -- cgit v1.2.3