1mod device;
8
9mod pal;
10
11pub use device::{DeviceDescriptor, MountPoint};
12use thiserror::Error;
13
14pub(crate) type Result<T, E = Error> = std::result::Result<T, E>;
15
16#[derive(Error, Debug)]
17pub enum Error {
18 #[cfg(target_os = "linux")]
19 #[error("Failed to execute lsblk.")]
20 LsblkExecuteError {
21 #[source]
22 source: Option<std::io::Error>,
23 },
24 #[cfg(target_os = "windows")]
25 #[error("Failed to get drive list.")]
26 WindowsError {
27 #[source]
28 #[from]
29 source: windows::core::Error,
30 },
31 #[cfg(target_os = "macos")]
32 #[error("Failed to create DiskArbitration session")]
33 MacosDiskArbitration,
34}
35
36pub fn drive_list() -> crate::Result<Vec<DeviceDescriptor>> {
38 pal::drive_list()
39}