pub struct DeviceFacts {
pub serial: Option<String>,
pub vendor_id: u16,
pub product_id: u16,
pub location_id: u64,
pub manufacturer: Option<String>,
pub product: Option<String>,
pub speed: Option<String>,
pub match_reason: Option<String>,
pub label: String,
}Expand description
Everything the USB watch reported about one device, as reported.
The fields are what key is derived from plus the strings that
let a person recognize the device in a scrolling log. Default is there so
tests can state only the fields they care about.
Fields§
§serial: Option<String>Serial number, exactly as reported (untrimmed).
vendor_id: u16USB vendor ID.
product_id: u16USB product ID.
location_id: u64USB topology position: which port the device is in.
manufacturer: Option<String>Manufacturer string from the USB descriptor.
product: Option<String>Product string from the USB descriptor.
speed: Option<String>Negotiated USB link speed, when the OS reports one.
match_reason: Option<String>Why mtp-rs classified this device as MTP. Arrivals only, in practice.
label: StringWhat the daemon calls the device in its log (MtpDeviceInfo::display()).
Implementations§
Source§impl DeviceFacts
impl DeviceFacts
Sourcepub fn key(&self) -> String
pub fn key(&self) -> String
The mount key: directory name and device identity in one.
This is the value the whole dry run is about. See
device_dir_name for the serial-then-USB-address rule.
Sourcepub fn ident(&self) -> DeviceIdent
pub fn ident(&self) -> DeviceIdent
What the supervisor would be handed for this device.
The daemon’s real path goes through here too
(crate::daemon::usb::ident_of is this function over an
MtpDeviceInfo), so a dry run and a live mount can’t derive keys
differently.