http.frm.connect
Connect 协议客户端(P8-A;unary 调用,protobuf 帧)
协议(Connect RPC unary,应用 proto 形):
POST /
pub struct
struct HttpNet
| Field | Type |
|---|---|
struct HttpSock
| Field | Type |
|---|---|
var fd |
I64 |
struct HttpLoc
| Field | Type |
|---|---|
ok |
I64 |
host |
Str |
port |
I64 |
path |
Str |
struct HttpResp
| Field | Type |
|---|---|
var rc |
I64 |
var err |
I64 |
var status |
I64 |
var ver |
I64 |
var keep |
I64 |
var nredir |
I64 |
var reuses |
I64 |
var head_end |
I64 |
var body_off |
I64 |
var body_len |
I64 |
struct Box64
| Field | Type |
|---|---|
var v |
I64 |
impl
impl Drop for HttpSock
fn drop(var self)
pub fn
| Signature | Returns | Description |
|---|---|---|
connect_path(service: Str, method: Str) |
Str |
请求路径:/<service>/<method> |
connect_headers() |
Str |
协议头(两行,自含 CRLF) |
connect_unary(net: HttpNet, host: Str, port: I64, service: Str, method: Str, req: &[I64], rlen: I64, resp: &[I64], rcap: I64, scr: &[I64], timeout_ms: I64, bfd: Box[Box64], bhh: Box[Box64], bpt: Box[Box64], bru: Box[Box64]) |
HttpResp |
unary 调用:返回 HttpResp(透传 client_request;消费方 rr_status/rr_body_* 读取,体 = 响应 protobuf 原文)。bfd/bhh/bpt/bru = client 连接状态四盒 (透传,复用与重连语义随 http.client)。 |
connect_classify(r: HttpResp) |
I64 |
状态分类:0 = 传输 IO 错;1 = HTTP 200(应用成功,proto 体);2 = 非 200 (HTTP 状态即错误面;JSON connect-error 帧解析列志向) |
connect_code_str(code: I64) |
Str |
connect/gRPC 状态码表(数字 → 规范名;HTTP 状态映射用) |
connect_code_from_http(status: I64) |
I64 |
HTTP 状态 → connect 码(grpc 映射子集;未表项 = 2 unknown) |
http_net() |
HttpNet |
— |
client_hash_host(host: Str) |
I64 |
— |
loc_ok(l: HttpLoc) |
I64 |
— |
loc_host(l: HttpLoc) |
Str |
— |
loc_port(l: HttpLoc) |
I64 |
— |
loc_path(l: HttpLoc) |
Str |
— |
client_loc_resolve(loc: Str, base_host: Str, base_port: I64) |
HttpLoc |
— |
rr_rc(r: HttpResp) |
I64 |
— |
rr_status(r: HttpResp) |
I64 |
— |
client_request(io: HttpNet, method: Str, host: Str, port: I64, path: Str, extra: Str, body: &[I64], blen: I64, buf: &[I64], cap: I64, scr: &[I64], timeout_ms: I64, bfd: Box[Box64], bhh: Box[Box64], bpt: Box[Box64], bru: Box[Box64]) |
HttpResp |
— |
http_limits_default() |
HttpLimits |
— |
http_err_line() |
I64 |
— |
http_err_line_long() |
I64 |
— |
http_err_version() |
I64 |
— |
http_err_token() |
I64 |
— |
http_err_target() |
I64 |
— |
http_err_hdr() |
I64 |
— |
http_err_fold() |
I64 |
— |
http_err_hdr_long() |
I64 |
— |
http_err_hdr_many() |
I64 |
— |
http_err_head_long() |
I64 |
— |
http_err_smuggle() |
I64 |
— |
http_err_cl() |
I64 |
— |
http_err_te() |
I64 |
— |
http_err_bodycap() |
I64 |
— |
http_parse_head(buf: &[I64], n: I64, lim: HttpLimits) |
HttpHead |
— |
http_header_at(buf: &[I64], h: HttpHead, idx: I64) |
HttpSlice |
— |
http_header_find(buf: &[I64], h: HttpHead, name: Str) |
I64 |
— |
http_header_value(buf: &[I64], h: HttpHead, name: Str) |
HttpSlice |
— |
http_keep_alive(buf: &[I64], h: HttpHead) |
I64 |
— |
http_rc(h: HttpHead) |
I64 |
— |
http_err_of(h: HttpHead) |
I64 |
— |
http_is_resp(h: HttpHead) |
I64 |
— |
http_ver(h: HttpHead) |
I64 |
— |
http_status_of(h: HttpHead) |
I64 |
— |
http_head_end(h: HttpHead) |
I64 |
— |
http_nheaders(h: HttpHead) |
I64 |
— |
http_body_kind(h: HttpHead) |
I64 |
— |
http_clen(h: HttpHead) |
I64 |
— |
http_method_len(h: HttpHead) |
I64 |
— |
http_target_len(h: HttpHead) |
I64 |
— |
sl_rc(s: HttpSlice) |
I64 |
— |
sl_vs(s: HttpSlice) |
I64 |
— |
sl_vl(s: HttpSlice) |
I64 |
— |
msg_hex(v: I64) |
Str |
— |
msg_request_line(method: Str, target: Str, ver: I64) |
Str |
— |
msg_status_line(ver: I64, status: I64, reason: Str) |
Str |
— |
msg_header(name: Str, value: Str) |
Str |
— |
msg_head_end() |
Str |
— |
msg_cl_header(n: I64) |
Str |
— |
msg_request_head(method: Str, target: Str, host: Str, ver: I64, body_len: I64) |
Str |
— |
msg_response_head(ver: I64, status: I64, reason: Str, body_len: I64) |
Str |
— |
msg_chunk_header(size: I64) |
Str |
— |
msg_last_chunk() |
Str |
— |
msg_last_chunk_trailer(name: Str, value: Str) |
Str |
— |
msg_continue() |
Str |
— |
msg_expect_header() |
Str |
— |
msg_should_expect(body_len: I64, threshold: I64) |
I64 |
— |
msg_body_remaining(head_end: I64, clen: I64, fed: I64) |
I64 |
— |
chunk_st_new() |
ChunkSt |
— |
cr_rc(r: ChunkRet) |
I64 |
— |
cr_err(r: ChunkRet) |
I64 |
— |
cr_consumed(r: ChunkRet) |
I64 |
— |
cr_produced(r: ChunkRet) |
I64 |
— |
cr_phase(r: ChunkRet) |
I64 |
— |
cr_remain(r: ChunkRet) |
I64 |
— |
chunk_step(src: &[I64], n: I64, pos: I64, st: ChunkSt, dst: &[I64], dfill: I64, dcap: I64) |
ChunkRet |
— |