pub enum OpticalError {
InvalidLedPwm,
InvalidIntegrationTime,
GestureDetectionDisabled,
Port {
source: PortError,
},
}Expand description
Errors that can occur when interacting with an optical sensor.
Variants§
InvalidLedPwm
Invalid LED PWM value, must be between 0 and 100.
InvalidIntegrationTime
Integration time must be between 3 and 712 milliseconds.
See https://www.vexforum.com/t/v5-optical-sensor-refresh-rate/109632/9 for more information.
GestureDetectionDisabled
Gesture detection is not enabled for this sensor.
Port
Generic port related error.
Trait Implementations§
Source§impl Debug for OpticalError
impl Debug for OpticalError
Source§impl Display for OpticalError
impl Display for OpticalError
Source§impl Error for OpticalError
impl Error for OpticalError
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 OpticalError
impl ErrorCompat for OpticalError
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 OpticalError
impl From<PortError> for OpticalError
Source§impl FromErrno for OpticalError
impl FromErrno for OpticalError
Source§fn from_errno(num: i32) -> Option<Self>
fn from_errno(num: i32) -> Option<Self>
Consume the current
errno and, if it contains a known error, returns Self.Auto Trait Implementations§
impl Freeze for OpticalError
impl RefUnwindSafe for OpticalError
impl Send for OpticalError
impl Sync for OpticalError
impl Unpin for OpticalError
impl UnwindSafe for OpticalError
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