pub struct FunctionRegistry<T> { /* private fields */ }Expand description
Holds the function symbols of an Executable
Implementations§
Source§impl<T> FunctionRegistry<T>
impl<T> 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 register_function_hashed(
&mut self,
name: impl Into<Vec<u8>>,
value: T,
) -> Result<u32, ElfError>
pub fn register_function_hashed( &mut self, name: impl Into<Vec<u8>>, value: T, ) -> Result<u32, ElfError>
Register a symbol with an implicit 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 for FunctionRegistry<T>where
T: Debug,
impl<T> Debug for FunctionRegistry<T>where
T: Debug,
Source§impl<T> Default for FunctionRegistry<T>
impl<T> Default for FunctionRegistry<T>
Source§fn default() -> FunctionRegistry<T>
fn default() -> FunctionRegistry<T>
Returns the “default value” for a type. Read more
Source§impl<T> PartialEq for FunctionRegistry<T>where
T: PartialEq,
impl<T> PartialEq for FunctionRegistry<T>where
T: PartialEq,
impl<T> Eq for FunctionRegistry<T>where
T: Eq,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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