#[non_exhaustive]pub struct AddressInfo {
pub library: PathBuf,
pub library_base: *mut c_void,
pub symbol: Option<CString>,
pub symbol_address: *mut c_void,
}Expand description
What the loader knows about an address: the library containing it and, where available, the nearest exported symbol.
let strlen = unsafe { lib.get::<*const u8>(c"strlen") }.unwrap();
let info = AddressInfo::of(strlen.as_ptr()).unwrap();
println!("strlen lives in {}", info.library.display());Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.library: PathBufPath of the library (or executable) containing the address.
library_base: *mut c_voidAddress the library is loaded at.
symbol: Option<CString>Name of the nearest exported symbol at or below the address
(Unix only; None on Windows or if there is none).
symbol_address: *mut c_voidAddress of that symbol (null if there is none).
Implementations§
Source§impl AddressInfo
impl AddressInfo
Trait Implementations§
Source§impl Clone for AddressInfo
impl Clone for AddressInfo
Auto Trait Implementations§
impl !Send for AddressInfo
impl !Sync for AddressInfo
impl Freeze for AddressInfo
impl RefUnwindSafe for AddressInfo
impl Unpin for AddressInfo
impl UnsafeUnpin for AddressInfo
impl UnwindSafe for AddressInfo
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