Struct detour::StaticDetourController
[−]
[src]
pub struct StaticDetourController<T: Function> { /* fields omitted */ }
An instantiator for StaticDetour.
This is the type used by the static_detours! macro, it cannot be created without it.
Methods
impl<T: Function> StaticDetourController<T>
[src]
pub unsafe fn initialize<C>(
&self,
target: T,
closure: C
) -> Result<StaticDetour<T>, Error> where
C: Fn<T::Arguments, Output = T::Output> + Send + 'static,
[src]
&self,
target: T,
closure: C
) -> Result<StaticDetour<T>, Error> where
C: Fn<T::Arguments, Output = T::Output> + Send + 'static,
Creates a StaticDetour initialized with a target and a closure.
If the detour has already been initialized, but it has not gone out of
scope, an AlreadyExisting
error will be thrown.
pub unsafe fn get(&self) -> Option<&GenericDetour<T>>
[src]
Returns a reference to the underlying detour.
It is provided so the original function can easily be called within a detour.
This is unsafe because the lifetime of the detour has no relation to the
actual detour returned by initialize
. Therefore it can be dropped at
any time. Prefer to use the handle returned from initialize
whenever
possible.
Trait Implementations
Auto Trait Implementations
impl<T> Send for StaticDetourController<T> where
T: Send,
T: Send,