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]

[src]

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.

[src]

Returns a reference to the underlying detour.

It is mostly 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.