API: Drive object, typed StreamUrl, tray lock/unlock, Send traits

- Rename DriveSession → Drive across entire codebase
- find_drives() returns Vec<Drive>, find_drive() returns Option<Drive>
- resolve_device() now pub(crate) — internal only
- StreamUrl is now a typed enum (Disc, Mkv, M2ts, Iso, Network, Stdio, Null)
  with scheme() and path_str() accessors, replacing struct of Strings
- Add lock_tray() / unlock_tray() for safe disc access during rips
- Improve reset() with eject cycle that clears LibreDrive stuck state
- Add Send bounds to ScsiTransport and PlatformDriver traits
- DiscOptions uses PathBuf instead of String for device/keydb paths
- Update doc example to use new Drive API
This commit is contained in:
MattJackson
2026-04-13 00:13:41 +00:00
parent fb1c35e653
commit f8b5a1eaf1
13 changed files with 254 additions and 201 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
//! Drive data capture — read hardware information via SCSI.
use crate::drive::DriveSession;
use crate::drive::Drive;
use crate::error::Result;
/// Raw data captured from a drive's SCSI responses.
@@ -51,14 +51,14 @@ const FEATURES: &[(u16, &str)] = &[
/// Capture all available drive data via SCSI commands.
/// Returns raw responses — no formatting, no zipping, no presentation.
pub fn capture_drive_data(session: &mut DriveSession) -> Result<DriveCapture> {
pub fn capture_drive_data(session: &mut Drive) -> Result<DriveCapture> {
let id = &session.drive_id;
// Already have INQUIRY from drive open
let inquiry = id.raw_inquiry.clone();
let gc_010c = id.raw_gc_010c.clone();
// Capture GET_CONFIG features using DriveSession's query methods
// Capture GET_CONFIG features using Drive's query methods
let mut features = Vec::new();
for &(code, name) in FEATURES {
if let Some(data) = session.get_config_feature(code) {