Struct assembly_pack::txt::manifest::Manifest
source · pub struct Manifest {
pub version: VersionLine,
pub files: BTreeMap<String, FileLine>,
}
Available on crate feature
manifest
only.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§
source§impl Manifest
impl Manifest
sourcepub fn from_buf_read<B: BufRead>(reader: &mut B) -> Result<Self>
pub fn from_buf_read<B: BufRead>(reader: &mut B) -> Result<Self>
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§
impl Eq for Manifest
impl StructuralPartialEq for Manifest
Auto Trait Implementations§
impl Freeze for Manifest
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnwindSafe for Manifest
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
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
§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
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