pub enum BackendError {
Disconnected,
Backend(String),
}Expand description
A failure raised by the HID backend beneath the HID++ channel layer.
Deliberately narrow. The only distinction anything above the transport branches on is “the device is gone” versus everything else, so a backend collapses its own error taxonomy into these two variants and every caller stays backend-agnostic.
Variants§
Disconnected
The device is unreachable — it vanished after being opened, or was already gone when the open was attempted.
The two are one case here: nothing in the crate treats them differently, and a backend cannot always tell them apart.
Backend(String)
Any other backend failure, carried as its message.
Backend error types are neither Serialize nor uniform across
backends, so the text is the whole payload — nothing matches on it.
Trait Implementations§
Source§impl Debug for BackendError
impl Debug for BackendError
Source§impl Display for BackendError
impl Display for BackendError
Source§impl Error for BackendError
impl Error for BackendError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<BackendError> for WriteError
Carries a backend failure across the IPC boundary as text.
impl From<BackendError> for WriteError
Carries a backend failure across the IPC boundary as text.
WriteError is Serialize and
BackendError is not, so the message is the payload; the typed error is
never matched on downstream.
The impl lives here rather than beside WriteError because BackendError
is the local half — the orphan rule allows exactly one of the two homes, and
openlogi-core must never depend on a backend.
Source§fn from(error: BackendError) -> Self
fn from(error: BackendError) -> Self
Source§impl From<BackendError> for PairingError
Carries a backend failure across the IPC boundary as text, as
From<BackendError> for WriteError does for writes.
impl From<BackendError> for PairingError
Carries a backend failure across the IPC boundary as text, as
From<BackendError> for WriteError does for writes.