comportlist = "0.1.2"
use comportlist::available_ports; for idx in available_ports(vec!["CNCPorts","Ports"]){ if let Some(ss) = idx.serial_number{ println!("{}",ss); } if let Some(ss) = idx.product { println!("{}",ss); } if let Some(ss) = idx.manufacturer{ println!("{}",ss); } }
标签:idx,windows,Some,ss,let,串口,println,rust From: https://www.cnblogs.com/hardfood/p/16975911.html