#[non_exhaustive]pub enum JointValidationError {
NonFinite {
field: &'static str,
},
OutOfRange {
field: &'static str,
min: f32,
max: f32,
},
MustBePositive {
field: &'static str,
},
NotUnit {
field: &'static str,
},
NotPlanar {
field: &'static str,
},
HingeRequired {
field: &'static str,
},
InvertedLimits,
}Expand description
The first invalid field in a joint description or live configuration.
Field names follow JointDesc, with paths such as limits.lower and
motor.max_speed. Validation never clamps or normalizes authored values.
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.
NonFinite
The named scalar, vector or quaternion contains NaN or infinity.
OutOfRange
A finite scalar or vector component is outside the inclusive bounds.
MustBePositive
Spring stiffness must be strictly greater than zero.
NotUnit
A rotation or hinge axis must have squared length within 0.001 of one.
NotPlanar
A planar anchor must have zero Z; rotations and axes must preserve +Z.
HingeRequired
Only hinge joints accept angular limits and motors.
InvertedLimits
The lower angular limit exceeds the upper angular limit.
Implementations§
Source§impl JointValidationError
impl JointValidationError
Sourcepub fn field(&self) -> &'static str
pub fn field(&self) -> &'static str
Returns the field to highlight in an editor or diagnostic.
use ferravex_physics::JointMotor;
let error = JointMotor::velocity(1., -1.).validate().unwrap_err();
assert_eq!(error.field(), "motor.max_torque");
assert!(error.to_string().contains("between 0 and 1000000000"));Trait Implementations§
Source§impl Clone for JointValidationError
impl Clone for JointValidationError
Source§fn clone(&self) -> JointValidationError
fn clone(&self) -> JointValidationError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JointValidationError
impl Debug for JointValidationError
Source§impl Display for JointValidationError
impl Display for JointValidationError
Source§impl Error for JointValidationError
impl Error for JointValidationError
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()
Source§impl PartialEq for JointValidationError
impl PartialEq for JointValidationError
impl Copy for JointValidationError
impl StructuralPartialEq for JointValidationError
Auto Trait Implementations§
impl Freeze for JointValidationError
impl RefUnwindSafe for JointValidationError
impl Send for JointValidationError
impl Sync for JointValidationError
impl Unpin for JointValidationError
impl UnwindSafe for JointValidationError
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