diff options
author | Andrew Clayton <a.clayton@nginx.com> | 2023-08-29 23:23:05 +0100 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2023-08-29 23:23:05 +0100 |
commit | f748851daf87ce40cd2fed8c205afc4482c689a1 (patch) | |
tree | 8d025a6f58a4ec407c89757f0751513d18ffcb23 /src/rust/unit-wasm-sys/rusty.rs | |
parent | 59cb1e8000e1b18e317cb1c19185eb3a1b5d4e9f (diff) | |
download | unit-wasm-f748851daf87ce40cd2fed8c205afc4482c689a1.tar.gz unit-wasm-f748851daf87ce40cd2fed8c205afc4482c689a1.tar.bz2 |
Rust/rusty: Re-order some functions more logically
This may not matter in rust (if you use a function before the compiler
has seen a definition for it), but anyway in preparation for adding a
uwr_get_http_total_content_sent() function, put the content length
related functions before the functions that return the content.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to '')
-rw-r--r-- | src/rust/unit-wasm-sys/rusty.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/rust/unit-wasm-sys/rusty.rs b/src/rust/unit-wasm-sys/rusty.rs index 5135f56..be7a5e1 100644 --- a/src/rust/unit-wasm-sys/rusty.rs +++ b/src/rust/unit-wasm-sys/rusty.rs @@ -95,14 +95,18 @@ pub fn uwr_get_http_server_name(ctx: *const luw_ctx_t) -> &'static str { C2S!(luw_get_http_server_name(ctx)) } -pub fn uwr_get_http_content(ctx: *const luw_ctx_t) -> *const u8 { - unsafe { luw_get_http_content(ctx) } -} - pub fn uwr_get_http_content_len(ctx: *const luw_ctx_t) -> usize { unsafe { luw_get_http_content_len(ctx) } } +pub fn uwr_get_http_content_sent(ctx: *const luw_ctx_t) -> usize { + unsafe { luw_get_http_content_sent(ctx) } +} + +pub fn uwr_get_http_content(ctx: *const luw_ctx_t) -> *const u8 { + unsafe { luw_get_http_content(ctx) } +} + pub fn uwr_get_http_content_str(ctx: *const luw_ctx_t) -> &'static str { unsafe { let slice = slice::from_raw_parts( @@ -113,10 +117,6 @@ pub fn uwr_get_http_content_str(ctx: *const luw_ctx_t) -> &'static str { } } -pub fn uwr_get_http_content_sent(ctx: *const luw_ctx_t) -> usize { - unsafe { luw_get_http_content_sent(ctx) } -} - pub fn uwr_http_is_tls(ctx: *const luw_ctx_t) -> bool { unsafe { luw_http_is_tls(ctx) } } |