Struct assembly_pack::txt::Manifest [−][src]
pub struct Manifest {
pub version: VersionLine,
pub files: BTreeMap<String, FileLine>,
}
Expand description
A manifest file in-memory
Fields
version: VersionLine
The parsed version line
files: BTreeMap<String, FileLine>
The parsed, sorted list of files
Implementations
Read a manifest from a BufRead implementation
use std::{io::Cursor, collections::BTreeMap};
use assembly_pack::{md5::MD5Sum, txt::{Manifest, VersionLine}};
let hash = MD5Sum::compute("32");
let text = format!("[version]\n32,{},Name\n[files]\n", hash);
let res = Manifest::from_buf_read(&mut Cursor::new(text));
match res {
Err(e) => panic!("{}", e),
Ok(m) => {
assert_eq!(m, Manifest {
version: VersionLine::new(32, String::from("Name")),
files: BTreeMap::new(),
});
}
}
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Manifest
impl UnwindSafe for Manifest
Blanket Implementations
Mutably borrows from an owned value. Read more
Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more