Struct hidapi::DeviceInfo[][src]

pub struct DeviceInfo { /* fields omitted */ }
Expand description

Device information. Use accessors to extract information about Hid devices.

Note: Methods like serial_number() may return None, if the conversion to a String failed internally. You can however access the raw hid representation of the string by calling serial_number_raw()

Implementations

Try to call serial_number_raw(), if None is returned.

Try to call manufacturer_string_raw(), if None is returned.

Try to call product_string_raw(), if None is returned.

Use the information contained in DeviceInfo to open and return a handle to a HidDevice.

By default the device path is used to open the device. When no path is available, then vid, pid and serial number are used. If both path and serial number are not available, then this function will fail with HidError::OpenHidDeviceWithDeviceInfoError.

Note, that opening a device could still be done using HidApi::open() directly.

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

Performs the conversion.

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.