pub struct Library { /* private fields */ }Expand description
A loaded patch library
Implementations§
Source§impl Library
impl Library
Sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self>
Load a patch library from the specified path
Sourcepub fn metadata(&self) -> &PatchMetadata
pub fn metadata(&self) -> &PatchMetadata
Get the patch metadata
Sourcepub unsafe fn get_symbol<T>(&self, name: &[u8]) -> Result<Symbol<'_, T>>
pub unsafe fn get_symbol<T>(&self, name: &[u8]) -> Result<Symbol<'_, T>>
Resolve a symbol by name
§Safety
The caller must ensure that the symbol has the correct type signature and that the library remains loaded for the lifetime of the symbol.
Sourcepub fn call_entry_point(&self) -> Result<()>
pub fn call_entry_point(&self) -> Result<()>
Try to get the entry point function and execute it
Sourcepub fn has_symbol(&self, name: &[u8]) -> bool
pub fn has_symbol(&self, name: &[u8]) -> bool
Check if the library has a specific symbol
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Library
impl RefUnwindSafe for Library
impl Send for Library
impl Sync for Library
impl Unpin for Library
impl UnwindSafe for Library
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