pub enum PortError {
Disconnected {
port: u8,
},
IncorrectDevice {
expected: SmartDeviceType,
actual: SmartDeviceType,
port: u8,
},
}
Expand description
Generic errors that can take place when using ports on the V5 Brain.
Variants§
Disconnected
No device is plugged into the port.
IncorrectDevice
An incorrect type of device is plugged into the port.
Fields
§
expected: SmartDeviceType
The device type that was expected
§
actual: SmartDeviceType
The device type that was found
Trait Implementations§
Source§impl Error for PortError
impl Error for PortError
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl ErrorCompat for PortError
impl ErrorCompat for PortError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source
. Read moreSource§impl From<PortError> for AddrLedError
impl From<PortError> for AddrLedError
Source§impl From<PortError> for AdiGyroscopeError
impl From<PortError> for AdiGyroscopeError
Source§impl From<PortError> for AiVisionError
impl From<PortError> for AiVisionError
Source§impl From<PortError> for DistanceError
impl From<PortError> for DistanceError
Source§impl From<PortError> for InertialError
impl From<PortError> for InertialError
Source§impl From<PortError> for MotorError
impl From<PortError> for MotorError
Auto Trait Implementations§
impl Freeze for PortError
impl RefUnwindSafe for PortError
impl Send for PortError
impl Sync for PortError
impl Unpin for PortError
impl UnwindSafe for PortError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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