pub struct Client {
pub user_agent: &'static str,
pub timeout: Duration,
pub response_max: usize,
pub tcp_buffer: usize,
}Expand description
How a board’s requests are made: what it calls itself, and its limits.
Start from Client::DEFAULT.
Fields§
§user_agent: &'static strThe User-Agent sent — the board’s name, so the far end’s logs say
who asked.
timeout: DurationHow long a whole exchange may take, DNS through the last byte. Default 30 seconds.
One deadline around all of it rather than one per step, because the caller cares how long it can be kept waiting, not which stage was slow — and the failure it bounds is a server that accepts a connection and then says nothing.
response_max: usizeBytes of response kept: status line, headers and body. Default 4 KiB.
A response larger than this is cut short. A chunked body cut short fails to parse, and a plain one comes back as a prefix — which is why it is a limit to size against the largest answer expected, generously, rather than a buffer to economize on.
tcp_buffer: usizeTCP buffer, in bytes, per direction. Default 4 KiB.