diff options
-rw-r--r-- | src/rust/unit-wasm-sys/rusty.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rust/unit-wasm-sys/rusty.rs b/src/rust/unit-wasm-sys/rusty.rs index bf9cd64..8132ef0 100644 --- a/src/rust/unit-wasm-sys/rusty.rs +++ b/src/rust/unit-wasm-sys/rusty.rs @@ -8,6 +8,8 @@ use std::ffi::c_char; use std::ffi::c_void; use std::ffi::CStr; +use std::fs::File; +use std::os::fd::{AsRawFd, RawFd}; use std::ptr::null_mut; use std::slice; use std::str; @@ -175,6 +177,17 @@ pub fn uwr_req_buf_append(ctx: *mut luw_ctx_t, src: *const u8) { } } +pub fn uwr_req_buf_copy(ctx: *mut luw_ctx_t, src: *const u8) { + unsafe { + luw_req_buf_copy(ctx, src); + } +} + +pub fn uwr_mem_splice_file(src: *const u8, f: &mut File) -> isize { + let fd: RawFd = f.as_raw_fd(); + unsafe { luw_mem_splice_file(src, fd) } +} + pub fn uwr_mem_fill_buf_from_req(ctx: *mut luw_ctx_t, from: usize) -> usize { unsafe { luw_mem_fill_buf_from_req(ctx, from) } } |