src/stdlib/network/http_stream/async.panack
Green: covered; red: known zero; amber: unavailable. Blank lines are outside the executable-start-line denominator.
1 import stdlib/network/http_stream/errors as errors 2 pub import stdlib/network/http_stream/errors::{HttpStreamError, HttpStreamErrorKind, HttpStreamOperation} 3 import stdlib/network/http_stream/errors::{HttpStreamOperation.Open, HttpStreamOperation.Read, HttpStreamOperation.Close} 4 // Raw bounded transport support. HTTP parsing and framing belong to the HTTP package. 5 // The deadline includes time between reads. Empty Bytes means end of stream. 6 // Handles belong to this invocation; close invalidates every alias. 7 // Cancellation of a pending read closes the stream. 8 pub async open(host: Str, port: Nat, tls: Bool, request: Bytes, response_limit: Nat, timeout: Duration): Result[HttpStream,HttpStreamError] { 9 errors.convert(await http_stream_open_async(host, port, tls, request, response_limit, timeout), Open(host, port, tls, response_limit, timeout)) 10 } 11 12 pub async read(stream: HttpStream): Result[Bytes,HttpStreamError] { 13 errors.convert(await http_stream_read_async(stream), Read()) 14 } 15 16 pub async close(stream: HttpStream): Result[Unit,HttpStreamError] { 17 errors.convert(await http_stream_close_async(stream), Close()) 18 } 19
Functions
[
{
"id": "declaration/3",
"name": "open",
"line": 8,
"state": "covered",
"entries": "4"
},
{
"id": "declaration/4",
"name": "read",
"line": 12,
"state": "covered",
"entries": "5"
},
{
"id": "declaration/5",
"name": "close",
"line": 16,
"state": "covered",
"entries": "3"
}
]Source branch outcomes
[]
Reviewed declaration exclusions
[
{
"id": "declaration/0",
"reason": "import",
"line": 1
},
{
"id": "declaration/1",
"reason": "import",
"line": 2
},
{
"id": "declaration/2",
"reason": "import",
"line": 3
},
{
"id": "declaration/3/tail/receiver",
"reason": "namespace-qualifier",
"line": 9
},
{
"id": "declaration/4/tail/receiver",
"reason": "namespace-qualifier",
"line": 13
},
{
"id": "declaration/5/tail/receiver",
"reason": "namespace-qualifier",
"line": 17
}
]