#[non_exhaustive]pub struct PortDetails {
pub path: String,
pub port_type: PortType,
pub vid: Option<u16>,
pub pid: Option<u16>,
pub serial_number: Option<String>,
pub manufacturer: Option<String>,
pub product: Option<String>,
pub interface: Option<u8>,
pub location: Option<String>,
pub by_id: Vec<String>,
pub by_path: Vec<String>,
}Expand description
One enumerated port. Unknown values are None (not "Unknown").
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.path: StringPort path (/dev/ttyUSB0, /dev/cu.usbmodem1, COM3, Android device path).
port_type: PortType§vid: Option<u16>§pid: Option<u16>§serial_number: Option<String>Full serial number (on Windows untruncated, like the 4.x map).
manufacturer: Option<String>§product: Option<String>§interface: Option<u8>USB interface number: tells the ports of one composite device (a modem’s
AT / NMEA / diag ports) apart. On macOS it can be the data interface. Desktop
with the core feature usb-port-details only, else None.
location: Option<String>Physical USB location as bus-port.port… (Linux sysfs busnum/devpath,
macOS IOKit locationID, Windows LocationPaths). Same socket, same value.
Desktop with the core feature usb-port-details only, else None.
by_id: Vec<String>Linux /dev/serial/by-id/* links to this port (empty elsewhere).
by_path: Vec<String>Linux /dev/serial/by-path/* links to this port (empty elsewhere).
Trait Implementations§
Source§impl Clone for PortDetails
impl Clone for PortDetails
Source§impl Debug for PortDetails
impl Debug for PortDetails
Source§impl Default for PortDetails
impl Default for PortDetails
Source§impl<'de> Deserialize<'de> for PortDetails
impl<'de> Deserialize<'de> for PortDetails
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PortDetails
Source§impl PartialEq for PortDetails
impl PartialEq for PortDetails
Source§impl Serialize for PortDetails
impl Serialize for PortDetails
impl StructuralPartialEq for PortDetails
Auto Trait Implementations§
impl Forget for PortDetails
impl Freeze for PortDetails
impl RefUnwindSafe for PortDetails
impl Send for PortDetails
impl Sync for PortDetails
impl Unpin for PortDetails
impl UnsafeUnpin for PortDetails
impl UnwindSafe for PortDetails
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more