pub struct Archive {
pub id: u16,
pub path: PathBuf,
pub size: u64,
/* private fields */
}Expand description
Represents a CASC archive file (data.XXX)
Fields§
§id: u16Archive ID (the XXX in data.XXX)
path: PathBufPath to the archive file
size: u64Current size of the archive
Implementations§
Source§impl Archive
impl Archive
Sourcepub fn open(&mut self) -> Result<&mut ArchiveReader>
pub fn open(&mut self) -> Result<&mut ArchiveReader>
Open the archive for reading
Sourcepub fn read_at_cow(&self, location: &ArchiveLocation) -> Result<Cow<'_, [u8]>>
pub fn read_at_cow(&self, location: &ArchiveLocation) -> Result<Cow<'_, [u8]>>
Read data from a specific location in the archive (zero-copy when possible)
Sourcepub fn read_at(&mut self, location: &ArchiveLocation) -> Result<Vec<u8>>
pub fn read_at(&mut self, location: &ArchiveLocation) -> Result<Vec<u8>>
Read data from a specific location in the archive (allocates)
Sourcepub fn contains(&self, location: &ArchiveLocation) -> bool
pub fn contains(&self, location: &ArchiveLocation) -> bool
Check if a file exists at the given location
Auto Trait Implementations§
impl Freeze for Archive
impl RefUnwindSafe for Archive
impl Send for Archive
impl Sync for Archive
impl Unpin for Archive
impl UnwindSafe for Archive
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