pub struct Relocation { /* private fields */ }
Implementations§
Source§impl Relocation
impl Relocation
pub const fn new(address: NonNull<c_void>) -> Self
Sourcepub fn from_id_offset<A1, A2>(id: A1, offset: A2) -> Result<Self, DataBaseError>where
A1: ResolvableAddress,
A2: ResolvableAddress,
pub fn from_id_offset<A1, A2>(id: A1, offset: A2) -> Result<Self, DataBaseError>where
A1: ResolvableAddress,
A2: ResolvableAddress,
Creates an instance from two resolvable addresses.
§Errors
Returns an error if either of the addresses cannot be resolved.
Sourcepub const fn cast<U>(&self) -> NonNull<U>
pub const fn cast<U>(&self) -> NonNull<U>
Cast to any type.
Equivalent to C++’s REL::Relocation::get
.
pub fn write<U>(&self, data: &U)
pub fn write_bytes(&self, data: &[u8])
pub fn swap_as_vfn<T>( &mut self, idx: usize, new_fn: *const (), ) -> NonNull<c_void>
pub fn write_fill(&mut self, value: u8, count: usize)
Trait Implementations§
Source§impl Clone for Relocation
impl Clone for Relocation
Source§fn clone(&self) -> Relocation
fn clone(&self) -> Relocation
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Relocation
impl Debug for Relocation
Source§impl PartialEq for Relocation
impl PartialEq for Relocation
Source§impl ResolvableAddress for Relocation
impl ResolvableAddress for Relocation
Source§fn address(&self) -> Result<NonNull<c_void>, DataBaseError>
fn address(&self) -> Result<NonNull<c_void>, DataBaseError>
Get the address.(No error returned)
Source§fn offset(&self) -> Result<NonZeroUsize, DataBaseError>
fn offset(&self) -> Result<NonZeroUsize, DataBaseError>
Returns the offset associated with this instance. Read more
Source§impl TryFrom<ID> for Relocation
impl TryFrom<ID> for Relocation
Source§impl TryFrom<Offset> for Relocation
impl TryFrom<Offset> for Relocation
Source§impl TryFrom<RelocationID> for Relocation
impl TryFrom<RelocationID> for Relocation
Source§type Error = DataBaseError
type Error = DataBaseError
The type returned in the event of a conversion error.
Source§impl TryFrom<VariantOffset> for Relocation
impl TryFrom<VariantOffset> for Relocation
Source§type Error = DataBaseError
type Error = DataBaseError
The type returned in the event of a conversion error.
impl Copy for Relocation
impl Eq for Relocation
impl StructuralPartialEq for Relocation
Auto Trait Implementations§
impl Freeze for Relocation
impl RefUnwindSafe for Relocation
impl !Send for Relocation
impl !Sync for Relocation
impl Unpin for Relocation
impl UnwindSafe for Relocation
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