#[non_exhaustive]pub enum AssemblyError {
Capacity(PhysicsError),
Body {
body: LocalBodyId,
error: PhysicsError,
},
Joint {
joint: LocalJointId,
error: PhysicsError,
},
}Expand description
Ordinary preflight failure. No world state or arena identity is changed. Forward references must resolve inside the final plan:
use ferravex_physics::{PhysicsError, assembly::{
Assembly, AssemblyError, LocalBodyId, LocalJointId,
}, d2::{JointBuilder, PhysicsWorld, RigidBody}};
let mut plan = Assembly::<RigidBody>::new();
let future = LocalBodyId::from_index(1);
assert_eq!(future.index(), 1);
let joint = plan.add_joint(LocalBodyId::from_index(0), future,
JointBuilder::hinge()).unwrap();
assert_eq!(joint, LocalJointId::from_index(0));
assert_eq!(joint.index(), 0);
let mut world = PhysicsWorld::default();
assert_eq!(world.insert_assembly(plan), Err(AssemblyError::Joint {
joint, error: PhysicsError::InvalidHandle,
}));
assert!(world.bodies.is_empty() && world.joints.is_empty());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.
Capacity(PhysicsError)
Combined staged/live body, collider or joint count exceeds its world cap.
Body
Invalid body, child geometry/settings, or dynamic mass.
Joint
Invalid local endpoint (InvalidHandle) or descriptor/type pair
(InvalidJoint). Endpoints are checked before the descriptor.
Trait Implementations§
Source§impl Clone for AssemblyError
impl Clone for AssemblyError
Source§fn clone(&self) -> AssemblyError
fn clone(&self) -> AssemblyError
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 AssemblyError
impl Debug for AssemblyError
Source§impl Display for AssemblyError
impl Display for AssemblyError
Source§impl Error for AssemblyError
impl Error for AssemblyError
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 AssemblyError
impl PartialEq for AssemblyError
impl Copy for AssemblyError
impl Eq for AssemblyError
impl StructuralPartialEq for AssemblyError
Auto Trait Implementations§
impl Freeze for AssemblyError
impl RefUnwindSafe for AssemblyError
impl Send for AssemblyError
impl Sync for AssemblyError
impl Unpin for AssemblyError
impl UnwindSafe for AssemblyError
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