pub enum WriteError {
Show 26 variants
Hid(String),
DeviceNotFound,
DeviceUnreachable {
index: u8,
},
FeatureUnsupported {
feature_hex: u16,
},
EmptyDpiList,
Hidpp(String),
HidppFeature {
operation: HidppOperation,
feature_hex: u16,
kind: HidppFeatureErrorKind,
},
UnsupportedResponse {
operation: HidppOperation,
feature_hex: u16,
},
RequestTimedOut {
operation: HidppOperation,
},
RuntimeInit {
message: String,
},
AgentUnavailable,
InvalidLightValue {
control: String,
value: u16,
},
LightUnsupported {
control: String,
},
AmbiguousRawDevice,
DpiUnsupported {
requested: Dpi,
},
DpiNotApplied {
requested: Dpi,
actual: Dpi,
},
HapticWaveformUnsupported {
waveform: u8,
},
ReportRateUnsupported {
requested: ReportRate,
},
ReportRateNotApplied {
requested: ReportRate,
actual: ReportRate,
},
BacklightChangeUnsupported {
change: BacklightChange,
},
BacklightNotApplied {
change: BacklightChange,
},
HapticsUnavailable {
status: u8,
},
HostRenameUnsupported,
HostSlotEmpty {
slot: u8,
},
HostNameRejected {
max_len: u8,
},
HostNameNotApplied {
requested: String,
actual: Option<String>,
},
}Expand description
Error returned by HID++ read/write operations.
Serializable + Clone so it can cross the agent↔GUI IPC unchanged: the GUI
classifies a device read/write error as permanent (FeatureUnsupported /
EmptyDpiList) vs transient, so the discriminating variant must survive the
wire — stringifying it would collapse every case to “transient” and a device
that genuinely lacks a feature would be re-probed forever. Variant order is
therefore wire format: changes require a PROTOCOL_VERSION bump (guarded
by openlogi-ipc/tests/wire_format.rs).
Variants§
Hid(String)
HID transport error serialized as text.
openlogi_hid::BackendError isn’t Serialize, so carry its message as
text; the typed error is never matched on (only constructed +
displayed).
DeviceNotFound
No currently connected device matched the requested route.
DeviceUnreachable
The HID node opened, but the target HID++ device index did not answer.
FeatureUnsupported
Device does not expose the requested HID++ feature.
EmptyDpiList
Device reported no valid DPI values.
Hidpp(String)
Generic HID++ protocol error serialized as text.
HidppFeature
HID++ feature error response.
Fields
operation: HidppOperationOperation being performed.
kind: HidppFeatureErrorKindHID++ feature error kind.
UnsupportedResponse
Device returned a structurally unsupported response.
Fields
operation: HidppOperationOperation being performed.
RequestTimedOut
HID++ request timed out.
Fields
operation: HidppOperationOperation that timed out.
RuntimeInit
Tokio runtime could not be initialized for a sync caller.
Background agent write path is unavailable.
InvalidLightValue
A standalone light value is outside the driver’s supported range.
Fields
LightUnsupported
The selected light driver does not implement a requested control.
AmbiguousRawDevice
Multiple raw HID nodes matched one physical route.
DpiUnsupported
A DPI write asked for a value the device does not report as supported.
Nothing was written: the device layer checks the device-reported list first rather than leaving the firmware to clamp, ignore or reject it.
DpiNotApplied
The device acknowledged a DPI write but reads back a different value, including after one re-write.
HapticWaveformUnsupported
A haptic play asked for a waveform the device does not advertise.
Nothing was sent: the device layer checks the 0x19b0 capability mask
first, as Logi Options+ does, so a retry cannot succeed.
ReportRateUnsupported
A report-rate write asked for a rate the device does not list for its current connection.
Nothing was written: the device layer checks the device-reported list first, so the firmware never has to clamp or reject it.
Fields
requested: ReportRateThe rejected rate.
ReportRateNotApplied
The device acknowledged a report-rate write but reads back a different rate — for instance a gaming mouse whose onboard profile owns the rate.
Fields
requested: ReportRateThe rate that was written.
actual: ReportRateThe rate the device reports afterwards.
BacklightChangeUnsupported
A backlight change the keyboard does not offer — a level beyond its
level count, or a mode, level or battery-saving control its 0x1982
capability bits leave out.
Nothing was written: the device layer checks a fresh read first.
Fields
change: BacklightChangeThe rejected change.
BacklightNotApplied
The keyboard acknowledged a backlight write but reads back a configuration without the change.
Fields
change: BacklightChangeThe change that was written.
A haptic play refused because the device reports a non-zero 0x19b0
haptic status.
Nothing was sent: Logi Options+ plays only while the status is zero, and the device layer applies the same gate, so a retry cannot succeed until the device reports otherwise.
HostRenameUnsupported
A rename of an Easy-Switch slot’s computer on a device whose 0x1815
capabilities leave renaming out.
Nothing was written.
HostSlotEmpty
A rename of an Easy-Switch slot that has no computer paired, or that the device does not have.
Nothing was written.
HostNameRejected
A host name that is empty, holds a NUL, or is longer than the slot stores.
Nothing was written.
HostNameNotApplied
The device acknowledged a host-name write but reads back another name.
Trait Implementations§
Source§impl Clone for WriteError
impl Clone for WriteError
Source§fn clone(&self) -> WriteError
fn clone(&self) -> WriteError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WriteError
impl Debug for WriteError
Source§impl<'de> Deserialize<'de> for WriteError
impl<'de> Deserialize<'de> for WriteError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WriteError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WriteError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for WriteError
impl Display for WriteError
impl Eq for WriteError
Source§impl Error for WriteError
impl Error for WriteError
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.