liblitho 0.2.0

cli tool to flash/clone the images to storage devices
Documentation
//! Storage device enumeration and capacity queries.

use crate::devices::DeviceInfo;
use anyhow::Result;

/// List disks and query size / removable state.
pub trait DeviceInventory {
    /// Enumerate whole disks suitable for flash/clone pickers.
    fn list_storage_devices() -> Result<Vec<DeviceInfo>>;

    /// Device capacity in bytes, if known.
    fn device_size_bytes(path: &str) -> Option<u64>;

    /// Device capacity in 512-byte sectors, if known.
    fn device_size_sectors(path: &str) -> Option<u64> {
        Self::device_size_bytes(path).map(|b| b / 512)
    }

    /// Whether the path is removable media (USB, SD, …).
    fn is_removable(path: &str) -> Result<bool>;
}