]> git.proxmox.com Git - proxmox-backup.git/blame - src/tape/changer/mod.rs
tape: more docs
[proxmox-backup.git] / src / tape / changer / mod.rs
CommitLineData
b107fdb9
DM
1mod email;
2pub use email::*;
3
4mod parse_mtx_status;
5pub use parse_mtx_status::*;
6
7mod mtx_wrapper;
8pub use mtx_wrapper::*;
9
10mod linux_tape;
11pub use linux_tape::*;
12
13use anyhow::Error;
14
15/// Interface to media change devices
16pub trait MediaChange {
17
18 /// Load media into drive
19 ///
20 /// This unloads first if the drive is already loaded with another media.
21 fn load_media(&mut self, changer_id: &str) -> Result<(), Error>;
22
23 /// Unload media from drive
24 ///
25 /// This is a nop on drives without autoloader.
26 fn unload_media(&mut self) -> Result<(), Error>;
27
28 /// Returns true if unload_media automatically ejects drive media
29 fn eject_on_unload(&self) -> bool {
30 false
31 }
32
33 /// List media changer IDs (barcodes)
34 fn list_media_changer_ids(&self) -> Result<Vec<String>, Error>;
35}