pub struct FunctionRegistry<T> { /* private fields */ }
Expand description
Holds the function symbols of an Executable
Implementations§
Source§impl<T: Copy + PartialEq> FunctionRegistry<T>
impl<T: Copy + PartialEq> FunctionRegistry<T>
Sourcepub fn register_function(
&mut self,
key: u32,
name: impl Into<Vec<u8>>,
value: T,
) -> Result<(), ElfError>
pub fn register_function( &mut self, key: u32, name: impl Into<Vec<u8>>, value: T, ) -> Result<(), ElfError>
Register a symbol with an explicit key
Sourcepub fn unregister_function(&mut self, key: u32)
pub fn unregister_function(&mut self, key: u32)
Unregister a symbol again
Sourcepub fn lookup_by_key(&self, key: u32) -> Option<(&[u8], T)>
pub fn lookup_by_key(&self, key: u32) -> Option<(&[u8], T)>
Get a function by its key
Sourcepub fn lookup_by_name(&self, name: &[u8]) -> Option<(&[u8], T)>
pub fn lookup_by_name(&self, name: &[u8]) -> Option<(&[u8], T)>
Get a function by its name
Trait Implementations§
Source§impl<T: Debug> Debug for FunctionRegistry<T>
impl<T: Debug> Debug for FunctionRegistry<T>
Source§impl<T> Default for FunctionRegistry<T>
impl<T> Default for FunctionRegistry<T>
Source§impl<T: PartialEq> PartialEq for FunctionRegistry<T>
impl<T: PartialEq> PartialEq for FunctionRegistry<T>
impl<T: Eq> Eq for FunctionRegistry<T>
impl<T> StructuralPartialEq for FunctionRegistry<T>
Auto Trait Implementations§
impl<T> Freeze for FunctionRegistry<T>
impl<T> RefUnwindSafe for FunctionRegistry<T>where
T: RefUnwindSafe,
impl<T> Send for FunctionRegistry<T>where
T: Send,
impl<T> Sync for FunctionRegistry<T>where
T: Sync,
impl<T> Unpin for FunctionRegistry<T>
impl<T> UnwindSafe for FunctionRegistry<T>where
T: RefUnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more