pub struct File { /* private fields */ }
Expand description
A memory-mapped NX file.
Implementations§
Source§impl File
impl File
Sourcepub unsafe fn open(path: &Path) -> Result<File, Error>
pub unsafe fn open(path: &Path) -> Result<File, Error>
Opens an NX file via memory-mapping. This also checks the magic bytes in the header.
This is unsafe because it assumes the NX file is correct and UB may occur if there are mistakes.
Sourcepub fn node_count(&self) -> u32
pub fn node_count(&self) -> u32
Number of nodes in the file
Sourcepub unsafe fn get_str(&self, index: u32) -> &str
pub unsafe fn get_str(&self, index: u32) -> &str
Gets the string at the specified index in the string table.
Sourcepub unsafe fn get_node(&self, index: u32) -> &Node
pub unsafe fn get_node(&self, index: u32) -> &Node
Gets the node data at the specified index in the node table.
Sourcepub unsafe fn get_audio(&self, index: u32, length: u32) -> &[u8] ⓘ
pub unsafe fn get_audio(&self, index: u32, length: u32) -> &[u8] ⓘ
Gets the audio data at the specified index in the node table.
Sourcepub unsafe fn get_bitmap(&self, index: u32) -> &[u8] ⓘ
pub unsafe fn get_bitmap(&self, index: u32) -> &[u8] ⓘ
Gets the bitmap data at the specified index in the node table.
Trait Implementations§
Auto Trait Implementations§
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