src/stdlib/network/http_stream.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 pub open(host: Str, port: Nat, tls: Bool, request: Bytes, response_limit: Nat, timeout: Duration): Result[HttpStream,HttpStreamError] { 8 errors.convert(http_stream_open_typed(host, port, tls, request, response_limit, timeout), Open(host, port, tls, response_limit, timeout)) 9 } 10 11 pub read(stream: HttpStream): Result[Bytes,HttpStreamError] { 12 errors.convert(http_stream_read_typed(stream), Read()) 13 } 14 15 pub close(stream: HttpStream): Result[Unit,HttpStreamError] { 16 errors.convert(http_stream_close_typed(stream), Close()) 17 } 18
Functions
[
{
"id": "declaration/3",
"name": "open",
"line": 7,
"state": "covered",
"entries": "4"
},
{
"id": "declaration/4",
"name": "read",
"line": 11,
"state": "covered",
"entries": "5"
},
{
"id": "declaration/5",
"name": "close",
"line": 15,
"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": 8
},
{
"id": "declaration/4/tail/receiver",
"reason": "namespace-qualifier",
"line": 12
},
{
"id": "declaration/5/tail/receiver",
"reason": "namespace-qualifier",
"line": 16
}
]