pub struct PatchableSite { /* private fields */ }Expand description
Self-describing handle for a patchable displacement (jump/call).
Implementations§
Source§impl PatchableSite
impl PatchableSite
Sourcepub const unsafe fn new(offset: CodeOffset, kind: LabelUse, addend: i64) -> Self
pub const unsafe fn new(offset: CodeOffset, kind: LabelUse, addend: i64) -> Self
Construct a site handle manually.
§Safety
offset in any image you later patch must be a valid displacement field of kind
with the same layout as when the site was emitted or recorded.
pub const fn offset(self) -> CodeOffset
pub const fn kind(self) -> LabelUse
pub const fn addend(self) -> i64
Sourcepub unsafe fn retarget(
self,
bytes: &mut [u8],
target_offset: CodeOffset,
) -> Result<(), AsmError>
pub unsafe fn retarget( self, bytes: &mut [u8], target_offset: CodeOffset, ) -> Result<(), AsmError>
Retarget this site in a mutable code image.
§Safety
bytes must be the code image this site was recorded against (same layout). The caller
synchronizes concurrent execution of the patched region.
Trait Implementations§
Source§impl Clone for PatchableSite
impl Clone for PatchableSite
Source§fn clone(&self) -> PatchableSite
fn clone(&self) -> PatchableSite
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PatchableSite
Source§impl Debug for PatchableSite
impl Debug for PatchableSite
impl Eq for PatchableSite
Source§impl Hash for PatchableSite
impl Hash for PatchableSite
Source§impl PartialEq for PatchableSite
impl PartialEq for PatchableSite
impl StructuralPartialEq for PatchableSite
Auto Trait Implementations§
impl Freeze for PatchableSite
impl RefUnwindSafe for PatchableSite
impl Send for PatchableSite
impl Sync for PatchableSite
impl Unpin for PatchableSite
impl UnsafeUnpin for PatchableSite
impl UnwindSafe for PatchableSite
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