pub struct Parser { /* private fields */ }Expand description
The parser of the proka executable.
§Usage
To use this parser, you must put an slice into the initializations.
If the content of the proka executable is in memory, the best way
is to use core::slice::from_raw_parts.
Implementations§
Source§impl Parser
impl Parser
Sourcepub unsafe fn init(buf: &'static [u8]) -> Result<Self, Error>
pub unsafe fn init(buf: &'static [u8]) -> Result<Self, Error>
Initialize the parser by passing a slice.
§Safety
You must ensure these before invoking this function:
- The slice’s pointer is accessible and properly mapped;
- The slice’s content is a valid executable (internally checked);
- The slice must contain the header and all section tables (internally checked).
If this crate is used on the kernel-side, you must first map the memory that the slice points to before invoking this function.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin for Parser
impl UnwindSafe for Parser
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