pub struct DetourHook<F> { /* private fields */ }Expand description
A detour function hook.
Implementations§
Source§impl<F: Copy> DetourHook<F>
impl<F: Copy> DetourHook<F>
Sourcepub unsafe fn attach(func: F, detour: F) -> Result<Self, DetourError>where
F: Debug,
pub unsafe fn attach(func: F, detour: F) -> Result<Self, DetourError>where
F: Debug,
Attach a hook to the target function.
§Safety
func and detour should be valid function pointers with same signature.
Sourcepub fn original_fn(&self) -> F
pub fn original_fn(&self) -> F
Get the original function pointer.
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for DetourHook<F>where
F: Freeze,
impl<F> RefUnwindSafe for DetourHook<F>where
F: RefUnwindSafe,
impl<F> Send for DetourHook<F>where
F: Send,
impl<F> Sync for DetourHook<F>where
F: Sync,
impl<F> Unpin for DetourHook<F>where
F: Unpin,
impl<F> UnsafeUnpin for DetourHook<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for DetourHook<F>where
F: UnwindSafe,
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