pub enum ServeError {
Source(SourceError),
Reply(StdioError),
Diagnostics(StdioError),
}Expand description
Why the session ended when it was not the peer ending it.
Every variant is terminal. The loop cannot tell a peer that has gone how it went, and carrying on would mean serving a conversation nobody is in.
Variants§
Source(SourceError)
The peer’s stream could not be read.
Latched by StdioSource, so this is where the session ends rather
than a frame that will be tried again.
Reply(StdioError)
A reply could not be written.
Includes StdioError::ReplyTooLarge, which
is refused before any byte reaches the stream — so a peer never sees a
truncated frame, which on a newline protocol it could not detect.
Diagnostics(StdioError)
The diagnostics channel could not be written.
Fatal rather than ignored, which is the opposite of the advice
Diagnostics::write_all offers a caller. The loop is the top of the
process: if it cannot say what it is doing, it should stop doing it,
rather than serve requests from a state only it knows about.
Trait Implementations§
Source§impl Debug for ServeError
impl Debug for ServeError
Source§impl Display for ServeError
impl Display for ServeError
Source§impl Error for ServeError
impl Error for ServeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()