Skip to main content

WriteError

Enum WriteError 

Source
pub enum WriteError {
Show 14 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,
}
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.

async_hid::HidError 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.

Fields

§index: u8

HID++ device index that failed to answer.

§

FeatureUnsupported

Device does not expose the requested HID++ feature.

Fields

§feature_hex: u16

HID++ feature ID that was not present.

§

EmptyDpiList

Device reported no valid DPI values.

§

Hidpp(String)

Generic HID++ protocol error serialized as text.

§

HidppFeature

HID++ feature error response.

Fields

§operation: HidppOperation

Operation being performed.

§feature_hex: u16

HID++ feature ID involved in the operation.

§kind: HidppFeatureErrorKind

HID++ feature error kind.

§

UnsupportedResponse

Device returned a structurally unsupported response.

Fields

§operation: HidppOperation

Operation being performed.

§feature_hex: u16

HID++ feature ID involved in the operation.

§

RequestTimedOut

HID++ request timed out.

Fields

§operation: HidppOperation

Operation that timed out.

§

RuntimeInit

Tokio runtime could not be initialized for a sync caller.

Fields

§message: String

Runtime initialization error message.

§

AgentUnavailable

Background agent write path is unavailable.

§

InvalidLightValue

A standalone light value is outside the driver’s supported range.

Fields

§control: String

Semantic control name.

§value: u16

Rejected value in the semantic/native unit supplied by the caller.

§

LightUnsupported

The selected light driver does not implement a requested control.

Fields

§control: String

Semantic control name.

§

AmbiguousRawDevice

Multiple raw HID nodes matched one physical route.

Trait Implementations§

Source§

impl Clone for WriteError

Source§

fn clone(&self) -> WriteError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WriteError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for WriteError

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for WriteError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for WriteError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl Serialize for WriteError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more