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 --- test_plugin/src/lib.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'test_plugin/src') diff --git a/test_plugin/src/lib.rs b/test_plugin/src/lib.rs index c88052e9a..0c8655c5d 100644 --- a/test_plugin/src/lib.rs +++ b/test_plugin/src/lib.rs @@ -1,17 +1,16 @@ -#[macro_use] extern crate deno_core; extern crate futures; +use deno_core::Buf; use deno_core::Op; -use deno_core::PluginInitContext; -use deno_core::{Buf, ZeroCopyBuf}; +use deno_core::ZeroCopyBuf; use futures::future::FutureExt; -fn init(context: &mut dyn PluginInitContext) { - context.register_op("testSync", Box::new(op_test_sync)); - context.register_op("testAsync", Box::new(op_test_async)); +#[no_mangle] +pub fn deno_plugin_init(isolate: &mut deno_core::Isolate) { + isolate.register_op("testSync", op_test_sync); + isolate.register_op("testAsync", op_test_async); } -init_fn!(init); pub fn op_test_sync( _isolate: &mut deno_core::Isolate, -- cgit v1.2.3