windows: Expose location_paths
This commit is contained in:
parent
e733fd1b95
commit
24cc1832bf
2 changed files with 11 additions and 0 deletions
|
|
@ -31,6 +31,9 @@ pub struct DeviceInfo {
|
|||
#[cfg(target_os = "windows")]
|
||||
pub(crate) instance_id: OsString,
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
pub(crate) location_paths: Vec<OsString>,
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
pub(crate) parent_instance_id: OsString,
|
||||
|
||||
|
|
@ -122,6 +125,12 @@ impl DeviceInfo {
|
|||
&self.instance_id
|
||||
}
|
||||
|
||||
/// *(Windows-only)* Location paths property
|
||||
#[cfg(target_os = "windows")]
|
||||
pub fn location_paths(&self) -> &[OsString] {
|
||||
&self.location_paths
|
||||
}
|
||||
|
||||
/// *(Windows-only)* Instance ID path of the parent hub
|
||||
#[cfg(target_os = "windows")]
|
||||
pub fn parent_instance_id(&self) -> &OsStr {
|
||||
|
|
@ -312,6 +321,7 @@ impl std::fmt::Debug for DeviceInfo {
|
|||
{
|
||||
s.field("instance_id", &self.instance_id);
|
||||
s.field("parent_instance_id", &self.parent_instance_id);
|
||||
s.field("location_paths", &self.location_paths);
|
||||
s.field("port_number", &self.port_number);
|
||||
s.field("driver", &self.driver);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ pub fn probe_device(devinst: DevInst) -> Option<DeviceInfo> {
|
|||
|
||||
Some(DeviceInfo {
|
||||
instance_id,
|
||||
location_paths,
|
||||
parent_instance_id,
|
||||
devinst,
|
||||
port_number,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue