#[non_exhaustive]pub enum SessionConfigError {
MissingField {
field: &'static str,
},
EmptyField {
field: &'static str,
},
FieldTooLong {
field: &'static str,
len: usize,
max: usize,
},
IllegalByte {
field: &'static str,
byte: u8,
position: usize,
},
FractionalHeartbeatInterval {
interval: Duration,
},
HeartbeatIntervalOutOfRange {
secs: u64,
min: u64,
max: u64,
},
HeartbeatDisabledWithoutOptIn,
TimeoutOutOfRange {
field: &'static str,
timeout: Duration,
max: Duration,
},
MessageSizeLimitOutOfRange {
size: usize,
min: usize,
max: usize,
},
}Expand description
Reason a session configuration cannot be used.
Every variant names the offending knob, so the message is actionable without the caller having to guess which setter produced it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingField
A field with no default was never set on the builder.
EmptyField
A string knob was set to the empty string.
An empty value has no wire form: the encoder refuses it, so it would fail at the first outbound message rather than at configuration time.
FieldTooLong
A string knob is longer than MAX_ID_LEN bytes.
Fields
IllegalByte
A string knob carries a byte with no on-the-wire form.
These values are written verbatim into the standard header, so SOH
would terminate the field early and = would open a new tag/value
pair: either byte structurally corrupts every outbound message.
Fields
FractionalHeartbeatInterval
The heartbeat interval is not a whole number of seconds.
HeartbeatIntervalOutOfRange
The heartbeat interval is outside the supported range.
Fields
HeartbeatDisabledWithoutOptIn
A zero heartbeat interval reached the builder without the explicit opt-in.
HeartBtInt = 0 is legal and means “do not heartbeat”, which switches
dead-peer detection off for the whole session. That is a decision, not
a default, so it has to be asked for by name.
TimeoutOutOfRange
A handshake timeout is zero or above MAX_TIMEOUT.
Fields
MessageSizeLimitOutOfRange
max_message_size is outside its supported range.
Trait Implementations§
Source§impl Clone for SessionConfigError
impl Clone for SessionConfigError
Source§fn clone(&self) -> SessionConfigError
fn clone(&self) -> SessionConfigError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionConfigError
impl Debug for SessionConfigError
Source§impl Display for SessionConfigError
impl Display for SessionConfigError
impl Eq for SessionConfigError
Source§impl Error for SessionConfigError
impl Error for SessionConfigError
1.30.0 · 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()