Age | Commit message (Collapse) | Author | Files | Lines |
|
There is no wrapper.h in the repository.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This in preparation for some upcoming changes.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This adds a nice wrapper (aka rusty) around the generated libunit-wasm
bindings.
This should provide a more native rust like experience with the
following benefits
- No casting. So no things like 'as *mut c_void'
- Native rust strings. So no things like '.as_ptr() as *const c_char'
- Better ctx initialisation. Filed initialisation is now hidden away
- Great reduction in the amount of unsafe {} blocks required
- Generally more compact
There are also some new macros
- C2S!() converts a CStr to a Str
- S2C!() converts a formatted Str to a Cstr using format!()
- uwr_write_str!() a wrapper around luw_mem_writep_data and format!()
This wrapper uses a uwr (Unit Wasm Rust) prefix under a 'rusty'
namespace.
The luw_http_hdr_iter() function proved tricky to wrap and the callback
function still takes C style arguments due to the fact that this
function is called from the libunit-wasm C library.
The provided wrapper simply means we can use this without having to use
an unsafe {} block around it in application code.
Similarly with other functions that technically didn't need to be
wrapped, wrapping them means that the unsafe {} blocks are hidden away.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
unit-wasm-sys 0.1.2
Might as well do this now before the code changes and we bump the
version again.
This version was published to crates.io
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
libunit-wasm and example C and Rust WebAssembly modules for NGINX Unit.
Co-developed-by: Timo Stark <t.stark@nginx.com>
Co-developed-by: Liam Crilly <liam@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|