#[non_exhaustive]pub enum ConfigError {
Show 28 variants
EmptyServerAddress,
MissingScheme {
address: String,
},
UnsupportedScheme {
scheme: String,
},
MissingHost {
address: String,
},
AddressHasUserinfo,
InvalidHost {
host: String,
},
InvalidPort {
port: String,
},
InvalidAddressPath {
path: String,
},
EmptyAdapterSet,
AdapterSetControlCharacter,
EmptyItemGroup,
ItemGroupControlCharacter,
ItemNameHasWhitespace {
name: String,
},
EmptyFieldSchema,
FieldSchemaControlCharacter,
FieldNameHasWhitespace {
name: String,
},
InvalidSequenceName {
name: String,
},
InvalidFrequency {
value: String,
},
SnapshotLengthNeedsDistinct {
mode: &'static str,
},
SnapshotNeedsAStatefulMode,
FrequencyNeedsAFilteredMode,
BufferSizeNeedsMergeOrDistinct {
mode: &'static str,
},
BufferSizeWithUnfilteredFrequency,
SequencedMessageNeedsAProgressive,
MaxWaitNeedsASequence,
ZeroDuration {
field: &'static str,
},
DurationTooLarge {
field: &'static str,
},
RetryCeilingBelowInitial {
initial: Duration,
max: Duration,
},
}Expand description
A configuration value that cannot be used as given.
Every variant names the one thing that is wrong and, where it helps, the offending value. No variant ever carries a password: a credential that reached an error message would end up in whatever log the caller writes the error to.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyServerAddress
The server address was empty or only whitespace.
MissingScheme
The server address has no scheme:// prefix.
The scheme is required rather than guessed, because defaulting to TLS or to plain text would each be wrong half the time and neither would be visible to the caller.
UnsupportedScheme
The server address names a scheme this crate cannot speak.
MissingHost
The server address has a scheme but no host after it.
AddressHasUserinfo
The server address carries a user:password@ prefix.
Refused rather than stripped, and deliberately reported without
quoting the address: an address that reached an error message would
take the credential in it into whatever log the error is written to.
Supply credentials with Credentials instead, where this crate
knows to redact them.
InvalidHost
The host part of the server address is not a host.
InvalidPort
The port part of the server address is not a port.
InvalidAddressPath
What follows the host in the server address is not a usable base path.
TLCP fixes the endpoint path [docs/spec/01-foundations.md §6.2.1], so
a query, a fragment or a .. segment either means something this crate
would silently drop or aims the connection at a different resource.
EmptyAdapterSet
The Adapter Set name was empty or only whitespace.
To request the server’s DEFAULT Adapter Set, leave the name unset
instead: naming the empty string is a different request, and not one a
caller means [docs/spec/03-requests.md §2.1].
AdapterSetControlCharacter
The Adapter Set name contains an ASCII control character.
EmptyItemGroup
A subscription named no items.
ItemGroupControlCharacter
An item group contains an ASCII control character.
ItemNameHasWhitespace
An item name in a list contains whitespace, which would split it into two items once the list is joined.
EmptyFieldSchema
A subscription named no fields.
FieldSchemaControlCharacter
A field schema contains an ASCII control character.
FieldNameHasWhitespace
A field name in a list contains whitespace, which would split it into two fields once the list is joined.
InvalidSequenceName
A message sequence name is not a legal identifier.
InvalidFrequency
A frequency limit is not a decimal number with a dot separator.
SnapshotLengthNeedsDistinct
A snapshot length was asked for in a mode that does not admit one.
LS_snapshot as a number of events is “admitted only if LS_mode is
DISTINCT” [docs/spec/03-requests.md §6.1].
SnapshotNeedsAStatefulMode
A snapshot was asked for in SubscriptionMode::Raw,
which keeps no item state and so has none to send
[docs/spec/03-requests.md §6.1].
FrequencyNeedsAFilteredMode
A maximum frequency was asked for in
SubscriptionMode::Raw, which the
server does not filter [docs/spec/03-requests.md §6.1].
BufferSizeNeedsMergeOrDistinct
A buffer size was asked for in a mode the server does not buffer.
LS_requested_buffer_size is considered “only if LS_mode is MERGE
or DISTINCT” [docs/spec/03-requests.md §6.1].
BufferSizeWithUnfilteredFrequency
A buffer size was asked for alongside an unfiltered frequency, which
the server ignores [docs/spec/03-requests.md §6.1].
SequencedMessageNeedsAProgressive
A Message::fire_and_forget message
was placed in a sequence.
The two are inseparable in the protocol: LS_msg_prog is “mandatory
whenever LS_sequence is specified” and a fire-and-forget message is
precisely one with no progressive [docs/spec/03-requests.md §12.1].
MaxWaitNeedsASequence
A maximum wait was set on a message that is in no sequence, where the
server ignores it [docs/spec/03-requests.md §12.1].
ZeroDuration
A duration that must be positive was zero.
DurationTooLarge
A duration is longer than this crate’s timers are defined for.
Either it does not fit the whole number of milliseconds the wire
carries, or it exceeds MAX_TIMING. Both are refused here rather
than clamped: a deadline that overflowed would become an immediate
one, inverting the very setting that produced it.
RetryCeilingBelowInitial
The reconnection ceiling is below the first reconnection delay, so the schedule could never be honoured.
Trait Implementations§
Source§impl Clone for ConfigError
impl Clone for ConfigError
Source§fn clone(&self) -> ConfigError
fn clone(&self) -> ConfigError
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 ConfigError
impl Debug for ConfigError
Source§impl Display for ConfigError
impl Display for ConfigError
impl Eq for ConfigError
Source§impl Error for ConfigError
impl Error for ConfigError
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()