#[non_exhaustive]pub enum ThrustCurveError {
Request {
what: &'static str,
value: String,
},
Net(NetError),
Json(String),
Api(String),
Count {
matches: u32,
found: usize,
},
Incomplete {
matches: u32,
found: usize,
},
Field {
field: String,
value: String,
},
OtherManufacturer {
asked: String,
found: String,
},
OtherMotor {
asked: String,
found: String,
},
Motor(MotorError),
}Expand description
Why a ThrustCurve request or answer was refused.
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.
Request
A request field is not one the API serves.
Net(NetError)
The fetch failed.
Json(String)
The body is not JSON of the expected shape: a field missing, or of the wrong type.
Api(String)
The answer carries the API’s error, or one of its criteria does.
Count
A search returns more motors than it says match.
Incomplete
A search returns fewer motors than match: its maxResults cut it short.
Field
A field breaks the API’s rules.
OtherManufacturer
A maker’s search holds another maker’s record.
OtherMotor
A download holds a file of another motor or format than asked.
Motor(MotorError)
hpr_motor’s reader refused a data file.
Trait Implementations§
Source§impl Debug for ThrustCurveError
impl Debug for ThrustCurveError
Source§impl Display for ThrustCurveError
impl Display for ThrustCurveError
Source§impl Error for ThrustCurveError
impl Error for ThrustCurveError
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()
Source§impl From<MotorError> for ThrustCurveError
impl From<MotorError> for ThrustCurveError
Source§fn from(source: MotorError) -> Self
fn from(source: MotorError) -> Self
Converts to this type from the input type.
Source§impl From<NetError> for ThrustCurveError
impl From<NetError> for ThrustCurveError
Source§impl From<ThrustCurveError> for FindError
impl From<ThrustCurveError> for FindError
Source§fn from(source: ThrustCurveError) -> Self
fn from(source: ThrustCurveError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ThrustCurveError
impl !UnwindSafe for ThrustCurveError
impl Freeze for ThrustCurveError
impl Send for ThrustCurveError
impl Sync for ThrustCurveError
impl Unpin for ThrustCurveError
impl UnsafeUnpin for ThrustCurveError
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