pub enum ServerError {
RandomSource {
reason: String,
},
TokenExhausted {
attempts: u32,
},
ReplyEncoding {
source: ProtoError,
},
}Expand description
An internal server failure.
This type deliberately does not describe rejected traffic. Malformed,
unauthenticated, unsupported and policy-refused datagrams are not errors:
the protocol defines no rejection response, so they are answered with
silence and reported as Ok(None) from
ServerCore::handle_datagram. An
inbound ProtoError never reaches a caller — that is the whole point of
the admission boundary, which turns hostile UDP into a dropped datagram
rather than a failure.
Every variant here is instead something wrong on this side, where the server could not do its job for a request it had already accepted.
Variants§
RandomSource
The operating system’s random source failed, so no session token could be drawn.
TokenExhausted
No unique non-zero token was found within the retry budget.
Each attempt drew a fresh value and rejected it as zero or as a collision with a live session. With a working random source this is vanishingly unlikely; it exists so token allocation cannot spin forever on a degenerate source.
ReplyEncoding
A reply the server itself constructed could not be encoded.
The ProtoError here always describes server-generated bytes, never
anything a peer sent.
Fields
source: ProtoErrorTrait Implementations§
Source§impl Debug for ServerError
impl Debug for ServerError
Source§impl Display for ServerError
impl Display for ServerError
impl Eq for ServerError
Source§impl Error for ServerError
impl Error for ServerError
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()