usbenum

Crates.iousbenum
lib.rsusbenum
version0.1.0
sourcesrc
created_at2021-08-23 06:52:49.050524
updated_at2021-08-23 06:52:49.050524
descriptionA cross platform library that can enumerate USB devices currently connected and get connection history
homepage
repositoryhttps://github.com/marirs/usbenum
max_upload_size
id441010
size26,813
SG (marirs)

documentation

README

USBENUM

Usb Enumeration is a cross-platform library that can enumerate USB devices currently connected and get connection history

Requirements

  • Rust 1.52+

Usage

  • Add to depedencies
[dependencies]
usbenum = "0.1.0"

and then

use usbenum::list_connected_usb_drives;

fn main() {
    match list_connected_usb_drives() {
        Ok(l) => {
            if l.is_empty() {
                println!("No currently connected usb drives")
            } else {
                println!("{:#?}", l)
            }
        }
        Err(e) => println!("{:?}", e),
    }
}
  • Running the example: cargo run --example connected_drives

License: MIT

Commit count: 19

cargo fmt