pub enum Ev3Error {
Show 14 variants
SensorNotFound {
port: SensorPort,
expected_sensor_type: SensorType,
},
MotorNotFound {
port: MotorPort,
},
FileNotFound {
path: PathBuf,
},
InvalidPath,
IncorrectSensorType {
expected: SensorType,
found: SensorType,
},
ParseStr {
input: String,
to: String,
},
PermissionDenied {
required_permission: FileMode,
},
InvalidStringBytes,
ReadAttributeFailure {
filename: PathBuf,
os_error: Error,
},
WriteAttributeFailure {
filename: PathBuf,
value: String,
os_error: Error,
},
ParseInt {
err: ParseIntError,
},
ParseFloat {
err: ParseFloatError,
},
InvalidValue {
func: String,
value: String,
},
NoSensorProvided,
}Expand description
The error type for the ev3dev_rs crate
Variants§
SensorNotFound
Unable to find a sensor.
Fields
port: SensorPortThe port the sensor was supposed to be on.
expected_sensor_type: SensorTypeThe expected sensor type.
MotorNotFound
Unable to find a motor.
FileNotFound
An internal error
InvalidPath
An internal error
IncorrectSensorType
Found the incorrect sensor
Fields
expected: SensorTypeThe type of the expected sensor.
found: SensorTypeThe type of the found sensor
ParseStr
Failed to parse a string into an enum variant.
PermissionDenied
An internal error
Fields
required_permission: FileModeThe permission that was expected
InvalidStringBytes
Failed to read the contents of a sysfs file to a string.
ReadAttributeFailure
Unable to read a motor or sensor attribute.
WriteAttributeFailure
Failed to write to an attribute of a sensor or motor.
Fields
ParseInt
Failed to parse an integer
Fields
err: ParseIntErrorThe raw error
ParseFloat
Failed to parse a floating point number.
Fields
err: ParseFloatErrorThe raw error
InvalidValue
Failed to read a string into an enum variant.
NoSensorProvided
No sensor was provided to something that needed it.
This was most likely caused by a DriveBase not being provided a GyroSensor.