]>
Commit | Line | Data |
---|---|---|
b107fdb9 DM |
1 | mod email; |
2 | pub use email::*; | |
3 | ||
4 | mod parse_mtx_status; | |
5 | pub use parse_mtx_status::*; | |
6 | ||
7 | mod mtx_wrapper; | |
8 | pub use mtx_wrapper::*; | |
9 | ||
10 | mod linux_tape; | |
11 | pub use linux_tape::*; | |
12 | ||
13 | use anyhow::Error; | |
14 | ||
15 | /// Interface to media change devices | |
16 | pub 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 | } |