pub struct Module<'a> { /* private fields */ }Expand description
A module whose header and table are checked; a section’s checksum is checked when it is read.
Implementations§
Source§impl<'a> Module<'a>
impl<'a> Module<'a>
Sourcepub fn read(bytes: &'a [u8]) -> Result<Self, ModuleError>
pub fn read(bytes: &'a [u8]) -> Result<Self, ModuleError>
Checks magic, version, length, header checksum, features, then the table, in that order.
pub fn version(&self) -> Version
Sourcepub fn sections(&self) -> &[SectionEntry]
pub fn sections(&self) -> &[SectionEntry]
The section table, in id order, with any optional section this reader does not know.
Sourcepub fn body(&self, id: u32) -> Result<&'a [u8], ModuleError>
pub fn body(&self, id: u32) -> Result<&'a [u8], ModuleError>
A section’s bytes, once its checksum matches.
pub fn strings(&self) -> Result<StringTable, ModuleError>
pub fn reader<'r>(
&self,
section: Section,
strings: &'r StringTable,
) -> Result<Reader<'r>, ModuleError>where
'a: 'r,
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Module<'a>
impl<'a> RefUnwindSafe for Module<'a>
impl<'a> Send for Module<'a>
impl<'a> Sync for Module<'a>
impl<'a> Unpin for Module<'a>
impl<'a> UnsafeUnpin for Module<'a>
impl<'a> UnwindSafe for Module<'a>
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