#[non_exhaustive]pub enum Error {
Show 21 variants
Transport(TransportError),
Codec(CodecError),
ConfigSchema(String),
ConfigIo(Error),
UnknownBusName(String),
UnknownVendor(String),
DuplicateBusName(String),
DuplicateGroupName(String),
MotorNotSupportedByCodec {
vendor: String,
motor_type: MotorTypeId,
bus_name: String,
},
GripperRequiresOneMotor {
got: usize,
},
CommandLengthMismatch {
expected: usize,
got: usize,
},
NotConnected,
OpeningOutOfRange {
got: f64,
},
OpeningCurrentOutOfRange {
got: f64,
},
OpeningCalibrationRequired,
OpeningCalibrationFailed {
name: String,
reason: String,
},
OpeningControlModeVerificationFailed {
name: String,
reason: String,
},
TopologyLocked,
CanIdCollision {
bus_name: String,
recv_id: u32,
existing: RouteKey,
attempted: RouteKey,
},
BusPoisoned,
Internal(&'static str),
}Expand description
All errors can-motor-control can return.
Wraps the lower-layer error types (TransportError, CodecError)
while adding composition-level variants (config schema, builder validation,
lifecycle).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transport(TransportError)
A transport operation failed.
Codec(CodecError)
A codec operation failed.
ConfigSchema(String)
TOML schema validation failed.
ConfigIo(Error)
Reading the config file failed.
UnknownBusName(String)
Reference to a bus name that wasn’t registered.
UnknownVendor(String)
Vendor name not in the codec registry.
DuplicateBusName(String)
Two add_bus calls used the same name.
DuplicateGroupName(String)
Two add_* group calls used the same name.
MotorNotSupportedByCodec
The bus’s codec does not support a motor type the user tried to add.
Fields
motor_type: MotorTypeIdMotor type the user attempted to add.
GripperRequiresOneMotor
Gripper construction tried to attach a number of motors other than 1.
CommandLengthMismatch
A batch command’s slice length didn’t match the group’s motor count.
NotConnected
Operation requires connect() first.
OpeningOutOfRange
Normalized gripper opening was outside the supported range.
OpeningCurrentOutOfRange
Per-unit opening current was outside the supported range.
OpeningCalibrationRequired
Normalized opening was requested before session calibration completed.
OpeningCalibrationFailed
Per-session gripper opening calibration failed.
OpeningControlModeVerificationFailed
Damiao opening-control mode could not be verified before enable.
TopologyLocked
Builder-style mutation after connect().
CanIdCollision
Two motors on one bus share the same recv ID.
Fields
BusPoisoned
The bus mutex was poisoned (a thread panicked while holding it).
Internal(&'static str)
Invariant violated.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()