#[non_exhaustive]pub enum Progress {
Idle,
Head,
Body,
AwaitingResponse,
WritingBody,
Upgraded,
Closed,
}Expand description
The phase of a connection, for drivers that run header-read, request,
and response deadlines: what ServerConn::progress and
ClientConn::progress report.
§Examples
use http_net::{Progress, ServerConn, ServerEvent};
let mut conn = ServerConn::new();
assert_eq!(conn.progress(), Progress::Idle);
let _ = conn.feed(b"GET / HTTP/1.1\r\n");
assert!(matches!(conn.poll(), Ok(ServerEvent::NeedInput)));
assert_eq!(conn.progress(), Progress::Head);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Idle
Between messages: no byte of the next one has been seen. Idle keep-alive time belongs to this phase, so a request deadline should not start here.
Head
Some bytes of a head have arrived; the head is not complete.
Body
The head is complete and body bytes are still to come.
AwaitingResponse
Server: the request is complete (or has no body left to read), or it was refused with a parse error, and its response is not finished. Client: the request was sent and nothing of the response has arrived, or a pipelined request is next.
WritingBody
A streamed body is being written: the response on a server, the request on a client.
Upgraded
The connection belongs to another protocol.
Closed
The connection is finished (or will be once the last response is written).