pub struct TocEntry {
pub filename: String,
pub size_bytes: Option<u64>,
pub parts: Option<RangeInclusive<u32>>,
}Expand description
One entry in a table-of-contents post.
A TOC entry describes a single file within a multi-part series. Not all
fields are present in every TOC format; size_bytes and parts are
None when the corresponding information was absent from the line.
§Example
use uuencoding_multi::parse_toc;
let body = b"archive.tar.gz 1234567 bytes parts 1-8\n";
let toc = parse_toc(body).unwrap();
let entry = &toc.entries[0];
assert_eq!(entry.filename, "archive.tar.gz");
assert_eq!(entry.size_bytes, Some(1_234_567));
assert_eq!(entry.parts, Some(1..=8));Fields§
§filename: StringFilename as it appears in the TOC line.
size_bytes: Option<u64>Declared file size in bytes, if present. KB and MB values are converted to bytes (1 KB = 1 024 bytes, 1 MB = 1 048 576 bytes).
parts: Option<RangeInclusive<u32>>Which parts carry this file, if a range was specified. The range is
inclusive on both ends (lo..=hi). Inverted ranges (lo > hi) are
silently discarded and produce None.
Trait Implementations§
impl StructuralPartialEq for TocEntry
Auto Trait Implementations§
impl Freeze for TocEntry
impl RefUnwindSafe for TocEntry
impl Send for TocEntry
impl Sync for TocEntry
impl Unpin for TocEntry
impl UnsafeUnpin for TocEntry
impl UnwindSafe for TocEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more