pub struct MuragentArchive {
pub files: BTreeMap<String, Vec<u8>>,
}Fields§
§files: BTreeMap<String, Vec<u8>>All files in the tarball keyed by path → raw bytes.
Implementations§
Source§impl MuragentArchive
impl MuragentArchive
Sourcepub fn read(path: &Path) -> Result<Self, MuragentError>
pub fn read(path: &Path) -> Result<Self, MuragentError>
Read and extract all files from a .muragent tar.gz.
Sourcepub fn read_from_bytes(data: &[u8]) -> Result<Self, MuragentError>
pub fn read_from_bytes(data: &[u8]) -> Result<Self, MuragentError>
Read and extract all files from .muragent bytes (in-memory gzip).
Used when fetching official packages that are not yet written to disk.
pub fn get(&self, path: &str) -> Option<&[u8]>
pub fn get_str(&self, path: &str) -> Result<&str, MuragentError>
pub fn files_as_vec(&self) -> Vec<(String, Vec<u8>)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MuragentArchive
impl RefUnwindSafe for MuragentArchive
impl Send for MuragentArchive
impl Sync for MuragentArchive
impl Unpin for MuragentArchive
impl UnsafeUnpin for MuragentArchive
impl UnwindSafe for MuragentArchive
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