#[non_exhaustive]
pub enum ErrorKind {
    Usb,
    DeviceNotFound,
    MultipleDevicesFound,
    MissingCapability,
    InterfaceNotSupported,
    Other,
}
Expand description

List of specific errors that may occur when using this library.

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.

Usb

A USB transport error occurred.

This variant is used for all errors reported by the operating system when performing a USB operation. It may indicate that the USB device was unplugged, that another application or an operating system driver is currently using it, or that the current user does not have permission to access it.

DeviceNotFound

No (matching) J-Link device was found.

This error occurs when calling JayLink::open_by_serial while no J-Link device is connected (or no device matching the serial number is connected).

MultipleDevicesFound

Automatic device connection failed because multiple devices were found.

This error occurs when calling JayLink::open_by_serial without a serial number while multiple J-Link devices are connected. This library will refuse to “guess” a device and requires specifying a serial number in this case. The scan_usb function can also be used to find a specific device to connect to.

MissingCapability

A operation was attempted that is not supported by the probe.

Some operations are not supported by all firmware/hardware versions, and are instead advertised as optional capability bits. This error occurs when the capability bit for an operation isn’t set when that operation is attempted.

Capabilities can be read by calling JayLink::capabilities, which returns a Capabilities bitflags struct.

InterfaceNotSupported

The device does not support the selected target interface.

Other

An unspecified error occurred.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.