pub trait ResolvableAddress {
// Required method
fn offset(&self) -> Result<NonZeroUsize, DataBaseError>;
// Provided methods
fn address(&self) -> Result<NonNull<c_void>, DataBaseError> { ... }
fn base() -> Result<NonNull<c_void>, ModuleStateError> { ... }
}
Expand description
A trait for resolving an absolute address based on an offset.
Implementing types must provide an offset()
method that returns the offset
used to compute the final address.
The base address is retrieved using the base()
method, which fetches
the module’s base address.
§Errors
- If the offset cannot be resolved,
offset()
returns aDataBaseError
. - If the base address cannot be retrieved,
base()
returns aModuleStateError
.
Required Methods§
Sourcefn offset(&self) -> Result<NonZeroUsize, DataBaseError>
fn offset(&self) -> Result<NonZeroUsize, DataBaseError>
Returns the offset associated with this instance.
§Errors
Returns an error if the offset cannot be determined.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.