pub struct Folder {
pub root: PathBuf,
pub tocs: Vec<String>,
pub layout: Layout,
/* private fields */
}Expand description
A data folder opened for reading: its TOCs, its CAS archives and the install chunks that name them.
Fields§
§root: PathBufThe folder, as given to Folder::open.
tocs: Vec<String>TOC paths relative to the folder, /-separated, sorted.
layout: LayoutThe folder’s layout.toc, read.
Implementations§
Source§impl Folder
impl Folder
Sourcepub fn open(root: impl Into<PathBuf>) -> Result<Self>
pub fn open(root: impl Into<PathBuf>) -> Result<Self>
Open the folder root (the one that holds layout.toc and Win32): finds its TOCs and CAS archives and
reads the install chunks of its layout.toc.
Sourcepub fn toc_path(&self, rel: &str) -> PathBuf
pub fn toc_path(&self, rel: &str) -> PathBuf
The path of the TOC rel (relative to the folder, as in Folder::tocs).
Sourcepub fn toc(&self, rel: &str) -> Result<Toc>
pub fn toc(&self, rel: &str) -> Result<Toc>
The TOC at rel (relative to the folder, as in Folder::tocs), read and parsed.
Sourcepub fn archive(&self, loc: Loc) -> Option<&Path>
pub fn archive(&self, loc: Loc) -> Option<&Path>
The CAS archive a Loc names, if the folder has it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Folder
impl RefUnwindSafe for Folder
impl Send for Folder
impl Sync for Folder
impl Unpin for Folder
impl UnsafeUnpin for Folder
impl UnwindSafe for Folder
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