Enum raestro::Error [−][src]
pub enum Error { Uninitialized, InvalidValue(u16), FaultyRead { actual_count: usize, }, FaultyWrite { actual_count: usize, expected_count: usize, }, Io(IoError), }
The custom raestro
error type.
Contains all custom error variants, as well as
a wrapper for the std::io::Error
enum. All
rppal
errors are unwrapped and
converted into their underlying
std::io::Error
instances, and then wrapped
in the Error::Io
variant.
Variants
The maestro
instance is in an
uninitialized
state.
Consider calling Maestro::start
with a
corresponding baudrate to transition
this instance into the initialized
state.
InvalidValue(u16)
An invalid value was passed in as a parameter.
Mainly used when an incorrect microsecond
target was passed into set_target
.
Occurs when the expected number of bytes
received from the Maestro do not
equal RESPONSE_SIZE
.
FaultyRead.0
is the number of bytes
actually read.
Show fields
Fields of FaultyRead
actual_count: usize
Occurs when the expected number of bytes written to the Maestro were incorrect (according to the protocol being sent).
Io(IoError)
Remaining IO errors as encountered by the
rppal
library, or something else.
Trait Implementations
impl Error for Error
[src]
impl Error for Error
[src]fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
fn description(&self) -> &str
1.0.0[src]
fn description(&self) -> &str
1.0.0[src]use the Display impl or to_string()
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more