api

async.ch

Declarations in async.ch

2 declarationshttp

Declarations

Public only
http#
Publicnamespace
namespace http
short per-accept timeout so it can observe `Server::run` for shutdown.
HttpResult#
Publicstruct
struct HttpResult { var ok : bool var status : uint var status_text : string var headers : HeaderMap var body : string var error : string }
* it also keeps the future payload to a single pointer. (This originally
is_ok#
Publicfunction
func is_ok(self : &HttpResult) : bool
status_code#
Publicfunction
func status_code(self : &HttpResult) : uint
body_view#
Publicfunction
func body_view(self : &HttpResult) : string_view
error_view#
Publicfunction
func error_view(self : &HttpResult) : string_view
delete#
function
func delete(self : *HttpResult) : void
* it also keeps the future payload to a single pointer. (This originally
http_box#
function
func http_box(client : *Client, r : Result<Response, string>) : *HttpResult
request_async#
Publicfunction
func request_async(client : *Client, req_builder : *RequestBuilder) : FutureHandle<*HttpResult>
get_async#
Publicfunction
func get_async(client : *Client, url_str : *string_view) : FutureHandle<*HttpResult>
post_async#
Publicfunction
func post_async(client : *Client, url_str : *string_view, body : *string_view, content_type : *char) : FutureHandle<*HttpResult>
put_async#
Publicfunction
func put_async(client : *Client, url_str : *string_view, body : *string_view, content_type : *char) : FutureHandle<*HttpResult>
patch_async#
Publicfunction
func patch_async(client : *Client, url_str : *string_view, body : *string_view, content_type : *char) : FutureHandle<*HttpResult>
delete_async#
Publicfunction
func delete_async(client : *Client, url_str : *string_view) : FutureHandle<*HttpResult>
head_async#
Publicfunction
func head_async(client : *Client, url_str : *string_view) : FutureHandle<*HttpResult>
read_chunk_async#
Publicfunction
func read_chunk_async(b : *Body, dst : *u8, cap : usize) : FutureHandle<int>
---- body ------------------------------------------------------------------
body_read_async#
Publicfunction
func body_read_async(b : *Body, dst : *u8, cap : usize) : FutureHandle<int>
read_to_string_async#
Publicfunction
func read_to_string_async(b : *Body) : FutureHandle<Option<string>>
server#
Publicnamespace
namespace server
---- server ----------------------------------------------------------------
serve_coro#
Publicfunction
func serve_coro(srv : *Server, port : uint) : FutureHandle<int>
Coroutine accept loop (R1: `serve_async` is taken by the thread variant).