pub struct Wad {
pub header: Header,
pub directory: Vec<DirEntry>,
pub data_offset: usize,
pub data: Vec<u8>,
}
Expand description
The actual WAD itself. Contains the WAD header, all directory entries and all the data stored in the WAD.
Fields
header: Header
directory: Vec<DirEntry>
data_offset: usize
data: Vec<u8>
Implementations
sourceimpl Wad
impl Wad
sourcepub fn parse_header(h: &[u8]) -> Header
pub fn parse_header(h: &[u8]) -> Header
Parses a Header from a WAD file and returns it.
sourcepub fn parse_entries(count: usize, d: &[u8]) -> Vec<DirEntry>
pub fn parse_entries(count: usize, d: &[u8]) -> Vec<DirEntry>
Parses all of the DirEntries in the WAD file and returns them.
sourcepub fn get_entry(&self, name: &[u8; 8]) -> Result<Vec<Vec<u8>>, WadError>
pub fn get_entry(&self, name: &[u8; 8]) -> Result<Vec<Vec<u8>>, WadError>
Indexes a WAD file for an entry.
pub unsafe fn get_entry_as<T>(&self, name: &[u8; 8]) -> Result<Vec<&T>, WadError>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Wad
impl Send for Wad
impl Sync for Wad
impl Unpin for Wad
impl UnwindSafe for Wad
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more