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 an slice.
§Safety
You must ensure these before invoking this function:
- The slice’s content is a valid executable;
- The slice’s pointer is accessable and mapped;
- The slice’s length is larger than 128 bytes.
If this crate has used by kernel, you need to do mapping first, and invoke this.
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