diff --git a/src/tape/changer/parse_mtx_status.rs b/src/tape/changer/parse_mtx_status.rs index 4b5a55c5..220a3141 100644 --- a/src/tape/changer/parse_mtx_status.rs +++ b/src/tape/changer/parse_mtx_status.rs @@ -9,19 +9,29 @@ use crate::tools::nom::{ parse_failure, parse_error, IResult, }; +/// Changer element status. +/// +/// Drive and slots may be `Empty`, or contain some media, either +/// with knwon volume tag `VolumeTag(String)`, or without (`Full`). pub enum ElementStatus { Empty, Full, VolumeTag(String), } +/// Changer drive status. pub struct DriveStatus { + /// The slot the element was loaded from (if known). pub loaded_slot: Option, + /// The status. pub status: ElementStatus, } +/// Changer status - show drive/slot usage pub struct MtxStatus { + /// List of known drives pub drives: Vec, + /// List of known slots pub slots: Vec, } diff --git a/src/tape/chunk_archive.rs b/src/tape/chunk_archive.rs index e6e6e672..ebbf9ac1 100644 --- a/src/tape/chunk_archive.rs +++ b/src/tape/chunk_archive.rs @@ -21,13 +21,13 @@ use crate::tape::{ }, }; -/// Writes chunk lists to tape. +/// Writes chunk archives to tape. /// -/// A chunk archive consists of a 'MediaContentHeader' followed by a +/// A chunk archive consists of a `MediaContentHeader` followed by a /// list of chunks entries. Each chunk entry consists of a -/// 'ChunkArchiveEntryHeader' folowed by thew chunk data ('DataBlob'). +/// `ChunkArchiveEntryHeader` folowed by the chunk data (`DataBlob`). /// -/// | MediaContentHeader | ( ChunkArchiveEntryHeader | DataBlob )* | +/// `| MediaContentHeader | ( ChunkArchiveEntryHeader | DataBlob )* |` pub struct ChunkArchiveWriter<'a> { writer: Option>, bytes_written: usize, // does not include bytes from current writer @@ -75,7 +75,7 @@ impl <'a> ChunkArchiveWriter<'a> { /// Write chunk into archive. /// - /// This may return false when LEOM is detected (when close_on_leom is set). + /// This may return false when `LEOM` is detected (when close_on_leom is set). /// In that case the archive only contains parts of the last chunk. pub fn try_write_chunk( &mut self, @@ -131,9 +131,9 @@ impl <'a> ChunkArchiveWriter<'a> { Ok(true) } - /// This must be called at the end to add padding and EOF + /// This must be called at the end to add padding and `EOF` /// - /// Returns true on LEOM or when we hit max archive size + /// Returns true on `LEOM` or when we hit max archive size pub fn finish(&mut self) -> Result { match self.writer.take() { Some(mut writer) => { diff --git a/src/tape/drive/mod.rs b/src/tape/drive/mod.rs index 3573f4db..dbd6d679 100644 --- a/src/tape/drive/mod.rs +++ b/src/tape/drive/mod.rs @@ -35,6 +35,7 @@ use crate::{ }; #[derive(Serialize,Deserialize)] +/// Contains `MediaLabel` and `MediaSetLabel`, including additional content Uuids pub struct MediaLabelInfo { pub label: MediaLabel, pub label_uuid: Uuid, diff --git a/src/tape/media_catalog.rs b/src/tape/media_catalog.rs index 7ec149b3..29d882b1 100644 --- a/src/tape/media_catalog.rs +++ b/src/tape/media_catalog.rs @@ -685,28 +685,28 @@ impl MediaSetCatalog { #[derive(Endian)] #[repr(C)] -pub struct LabelEntry { +struct LabelEntry { file_number: u64, uuid: [u8;16], } #[derive(Endian)] #[repr(C)] -pub struct ChunkArchiveStart { +struct ChunkArchiveStart { file_number: u64, uuid: [u8;16], } #[derive(Endian)] #[repr(C)] -pub struct ChunkArchiveEnd{ +struct ChunkArchiveEnd{ file_number: u64, uuid: [u8;16], } #[derive(Endian)] #[repr(C)] -pub struct SnapshotEntry{ +struct SnapshotEntry{ file_number: u64, uuid: [u8;16], name_len: u16, diff --git a/src/tape/media_pool.rs b/src/tape/media_pool.rs index 71e183a5..543ed3a3 100644 --- a/src/tape/media_pool.rs +++ b/src/tape/media_pool.rs @@ -34,6 +34,7 @@ use crate::{ } }; +/// Media Pool lock guard pub struct MediaPoolLockGuard(std::fs::File); /// Media Pool