Skip to main content

Function

Trait Function 

Source
pub trait Function {
    // Required method
    unsafe fn from_ptr(ptr: *const u8) -> Self;
}
Expand description

A function that is exported from a Module.

Required Methods§

Source

unsafe fn from_ptr(ptr: *const u8) -> Self

Creates a new function from a raw pointer to generated machine code.

§Unsafety

This is probably as unsafe as it gets, since the passed-in pointer will be treated as a pointer to arbitrary machine code. The pointer must come from a trusted source.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<R> Function for Function0<R>

Source§

impl<R, A1> Function for Function1<R, A1>

Source§

impl<R, A1, A2> Function for Function2<R, A1, A2>

Source§

impl<R, A1, A2, A3> Function for Function3<R, A1, A2, A3>

Source§

impl<R, A1, A2, A3, A4> Function for Function4<R, A1, A2, A3, A4>

Source§

impl<R, A1, A2, A3, A4, A5> Function for Function5<R, A1, A2, A3, A4, A5>

Source§

impl<R, A1, A2, A3, A4, A5, A6> Function for Function6<R, A1, A2, A3, A4, A5, A6>