#[non_exhaustive]pub enum KeyError {
Malformed {
text: String,
reason: &'static str,
},
UnknownProduct {
venue: String,
product: String,
},
WrongProduct {
expected: String,
found: String,
},
InvalidId {
product: String,
id: String,
reason: String,
},
}Expand description
Why text or a key named no instrument a product could read. Every one is
an InvalidRequest: the caller named something
no request can carry.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Malformed
The text is not venue.product:id.
UnknownProduct
No product this build enables has the key’s venue and product ids.
WrongProduct
A product was handed a key of another product.
Fields
InvalidId
The product does not read the id as one of its own.
Implementations§
Trait Implementations§
Source§impl Classify for KeyError
An InvalidRequest, whatever the case.
impl Classify for KeyError
An InvalidRequest, whatever the case.
Source§fn is_fault(&self) -> bool
fn is_fault(&self) -> bool
Whether this error is a fault, rather than the venue answering as
designed. False only for defined outcomes, such as a Fill-And-Kill order
that matched nothing, or a venue that does not serve the caller’s
region. Alerting should key on this; retrying should not.
Source§fn retry_after(&self) -> Option<Duration>
fn retry_after(&self) -> Option<Duration>
How long the server asked the caller to wait. Defaults to the class’s
own; an error whose wait outlives its class, such as a ban that says
when it lifts, overrides it. Never
Some of zero.Source§fn is_retriable(&self) -> bool
fn is_retriable(&self) -> bool
Whether retrying could plausibly succeed, read from the class (see
Class::is_retriable).impl Eq for KeyError
Source§impl Error for KeyError
impl Error for KeyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for KeyError
Auto Trait Implementations§
impl Freeze for KeyError
impl RefUnwindSafe for KeyError
impl Send for KeyError
impl Sync for KeyError
impl Unpin for KeyError
impl UnsafeUnpin for KeyError
impl UnwindSafe for KeyError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more