#[non_exhaustive]pub enum Error {
Io(Error),
Backend(Error),
InvalidConfig(String),
AlreadyLocked {
device: String,
pid: i32,
lock_file: PathBuf,
},
InvalidLock(String),
}Expand description
All fallible operations in rtcom-core funnel into this enum.
New variants may be added in minor releases; match with a trailing _
arm when you care about forward-compatibility.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Io(Error)
I/O error from the host OS, typically while reading from or writing to the serial device.
Backend(Error)
Error reported by the underlying serialport / tokio_serial
backend (for example, port not found, busy, or unsupported setting).
InvalidConfig(String)
The supplied SerialConfig value is invalid —
e.g. a baud rate of zero.
AlreadyLocked
Another live process already owns the device, advertised by a UUCP lock file. The error carries enough context to print a useful diagnostic.
Fields
InvalidLock(String)
A UUCP lock file exists but its content cannot be parsed as a PID. The lock is treated as stale and removed.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
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