Error
pub struct Error
A failed SDK call: what went wrong, and why.
Carries both halves of the C API's error model: the status code from the call, and the human-readable reason the SDK recorded for the calling thread. The message is copied out immediately, because the C's own buffer is only valid until the next SDK call on that thread.
A Status::Busy error carries a third thing: BusyReport,
read at the same instant and for the same reason. By the time a
caller is in its error arm, any other SDK call on this thread has
already cleared it.
Error — methods
pub fn status(&self) -> Status
The status code the call returned.
pub fn message(&self) -> &str
The SDK's description of what went wrong.
pub fn busy_report(&self) -> Option<&BusyReport>
Why a busy refusal happened, for a Status::Busy error.
None for every other status, which is the distinction worth
keeping: BusyReason::Unknown means the refusal did not
say, and offering it on an unrelated failure would invite
reading it as a cause.
Read before showing anything to an operator. One of the four reasons means nothing holds the camera at all, so showing it as in use is simply wrong.
pub fn busy_reason(&self) -> BusyReason
Shorthand for the reason alone, or BusyReason::Unknown.