Crates.io | rs-drivelist |
lib.rs | rs-drivelist |
version | 0.9.3 |
source | src |
created_at | 2023-03-29 07:48:35.176625 |
updated_at | 2023-06-22 23:10:04.054282 |
description | This is basically a Rust implementation of [Balena's drivelist](https://github.com/balena-io-modules/drivelist) |
homepage | |
repository | https://github.com/ir1keren/rs-drivelist.git |
max_upload_size | |
id | 823836 |
size | 50,953 |
This is basically a Rust implementation of Balena's drivelist. At the moment, I don't own a Mac machine, so it only supports:
Issue command at your root project directory:
cargo add "rs-drivelist"
Or edit your Cargo.toml
file, and add this line:
rs-drivelist = "0.9.0"
This library exports one function: rs_drivelist::drive_list() which returns a Result
of Vec<DeviceDescriptor>
[{
"enumerator": "SCSI",
"busType": "NVME",
"busVersion": "2.0",
"device": "\\\\.\\PhysicalDrive0",
"devicePath": null,
"raw": "\\\\.\\PhysicalDrive0",
"description": "SKHynix_HFM512GDHTNI-87A0B",
"error": null,
"partitionTableType": "gpt",
"size": 512110190592,
"blockSize": 4096,
"logicalBlockSize": 512,
"mountpoints": [
{
"path": "C:\\",
"label": null,
"totalBytes": 136773103616,
"availableBytes": 24087683072
},
{
"path": "D:\\",
"label": null,
"totalBytes": 218398453760,
"availableBytes": 35988631552
}
],
"isReadOnly": false,
"isSystem": true,
"isCard": false,
"isSCSI": false,
"isUSB": false,
"isVirtual": false,
"isRemovable": false,
"isUAS": false
}]
[{
"enumerator": "lsblk:json",
"busType": "NVME",
"busVersion": null,
"device": "/dev/nvme0n1",
"devicePath": "/dev/disk/by-path/pci-0000:02:00.0-nvme-1",
"raw": "/dev/nvme0n1",
"description": " SKHynix_HFM512GDHTNI-87A0B SYSTEM_DRV, Mazter, Home, WINRE_DRV",
"error": null,
"partitionTableType": "gpt",
"size": 512110190592,
"blockSize": 512,
"logicalBlockSize": 512,
"mountpoints": [
{
"path": "/boot/efi",
"label": "SYSTEM_DRV",
"totalBytes": 583942144,
"availableBytes": 541696000
},
{
"path": "[SWAP]",
"label": null,
"totalBytes": null,
"availableBytes": null
},
{
"path": "/",
"label": null,
"totalBytes": 67317620736,
"availableBytes": 47072321536
},
{
"path": "/home",
"label": "Home",
"totalBytes": 67050090496,
"availableBytes": 9986170880
}
],
"isReadOnly": false,
"isSystem": true,
"isCard": false,
"isSCSI": false,
"isUSB": false,
"isVirtual": false,
"isRemovable": false,
"isUAS": null
}]