summaryrefslogtreecommitdiff
path: root/src/libdeno.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-09-27 17:33:10 -0400
committerGitHub <noreply@github.com>2018-09-27 17:33:10 -0400
commitd38ccfc6dcb8643daa4f9e695d47a79cf068f90e (patch)
treed36ad2934e8550242d50e866f4ad2b6c303646b7 /src/libdeno.rs
parentbf93ca54dd85686c7b93a6189913e48e10de8dcf (diff)
Support zero-copy data in libdeno.send(). (#838)
This is a large API refactor of deno.h which replaces deno_send() and deno_set_response() with deno_respond(). It also adds a req_id parameter to the deno_recv_cb. Make writeFile/writeFileSync use it.
Diffstat (limited to 'src/libdeno.rs')
-rw-r--r--src/libdeno.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libdeno.rs b/src/libdeno.rs
index 637b3ef91..c7a03e3bb 100644
--- a/src/libdeno.rs
+++ b/src/libdeno.rs
@@ -19,7 +19,12 @@ pub struct deno_buf {
pub data_len: usize,
}
-type DenoRecvCb = unsafe extern "C" fn(d: *const isolate, buf: deno_buf);
+type DenoRecvCb = unsafe extern "C" fn(
+ d: *const isolate,
+ req_id: i32,
+ buf: deno_buf,
+ data_buf: deno_buf,
+);
extern "C" {
pub fn deno_init();
@@ -29,8 +34,7 @@ extern "C" {
pub fn deno_delete(i: *const isolate);
pub fn deno_last_exception(i: *const isolate) -> *const c_char;
pub fn deno_get_data(i: *const isolate) -> *const c_void;
- pub fn deno_set_response(i: *const isolate, buf: deno_buf);
- pub fn deno_send(i: *const isolate, buf: deno_buf);
+ pub fn deno_respond(i: *const isolate, req_id: i32, buf: deno_buf);
pub fn deno_execute(
i: *const isolate,
js_filename: *const c_char,