pub struct JitFunction<'ctx, F> { /* private fields */ }
Expand description

A wrapper around a function pointer which ensures the function being pointed to doesn’t accidentally outlive its execution engine.

Implementations§

source§

impl<'ctx, F: Copy> JitFunction<'ctx, F>

source

pub unsafe fn into_raw(self) -> F

Returns the raw function pointer, consuming self in the process. This function is unsafe because the function pointer may dangle if the ExecutionEngine it came from is dropped. The caller is thus responsible for ensuring the ExecutionEngine remains valid.

source

pub unsafe fn as_raw(&self) -> F

Returns the raw function pointer. This function is unsafe because the function pointer may dangle if the ExecutionEngine it came from is dropped. The caller is thus responsible for ensuring the ExecutionEngine remains valid.

source§

impl<Output, A, B, C, D, E, F, G, H, I, J, K, L, M> JitFunction<'_, unsafe extern "C" fn(_: A, _: B, _: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L, _: M) -> Output>

source

pub unsafe fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M ) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, B, C, D, E, F, G, H, I, J, K, L, M> JitFunction<'_, unsafe extern "C" fn(_: B, _: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L, _: M) -> Output>

source

pub unsafe fn call( &self, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M ) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, C, D, E, F, G, H, I, J, K, L, M> JitFunction<'_, unsafe extern "C" fn(_: C, _: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L, _: M) -> Output>

source

pub unsafe fn call( &self, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M ) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, D, E, F, G, H, I, J, K, L, M> JitFunction<'_, unsafe extern "C" fn(_: D, _: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L, _: M) -> Output>

source

pub unsafe fn call( &self, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M ) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, E, F, G, H, I, J, K, L, M> JitFunction<'_, unsafe extern "C" fn(_: E, _: F, _: G, _: H, _: I, _: J, _: K, _: L, _: M) -> Output>

source

pub unsafe fn call( &self, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M ) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, F, G, H, I, J, K, L, M> JitFunction<'_, unsafe extern "C" fn(_: F, _: G, _: H, _: I, _: J, _: K, _: L, _: M) -> Output>

source

pub unsafe fn call( &self, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M ) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, G, H, I, J, K, L, M> JitFunction<'_, unsafe extern "C" fn(_: G, _: H, _: I, _: J, _: K, _: L, _: M) -> Output>

source

pub unsafe fn call(&self, G: G, H: H, I: I, J: J, K: K, L: L, M: M) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, H, I, J, K, L, M> JitFunction<'_, unsafe extern "C" fn(_: H, _: I, _: J, _: K, _: L, _: M) -> Output>

source

pub unsafe fn call(&self, H: H, I: I, J: J, K: K, L: L, M: M) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, I, J, K, L, M> JitFunction<'_, unsafe extern "C" fn(_: I, _: J, _: K, _: L, _: M) -> Output>

source

pub unsafe fn call(&self, I: I, J: J, K: K, L: L, M: M) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, J, K, L, M> JitFunction<'_, unsafe extern "C" fn(_: J, _: K, _: L, _: M) -> Output>

source

pub unsafe fn call(&self, J: J, K: K, L: L, M: M) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, K, L, M> JitFunction<'_, unsafe extern "C" fn(_: K, _: L, _: M) -> Output>

source

pub unsafe fn call(&self, K: K, L: L, M: M) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, L, M> JitFunction<'_, unsafe extern "C" fn(_: L, _: M) -> Output>

source

pub unsafe fn call(&self, L: L, M: M) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output, M> JitFunction<'_, unsafe extern "C" fn(_: M) -> Output>

source

pub unsafe fn call(&self, M: M) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

source§

impl<Output> JitFunction<'_, unsafe extern "C" fn() -> Output>

source

pub unsafe fn call(&self) -> Output

This method allows you to call the underlying function while making sure that the backing storage is not dropped too early and preserves the unsafe marker for any calls.

Trait Implementations§

source§

impl<'ctx, F: Clone> Clone for JitFunction<'ctx, F>

source§

fn clone(&self) -> JitFunction<'ctx, F>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F> Debug for JitFunction<'_, F>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'ctx, F> RefUnwindSafe for JitFunction<'ctx, F>
where F: RefUnwindSafe,

§

impl<'ctx, F> !Send for JitFunction<'ctx, F>

§

impl<'ctx, F> !Sync for JitFunction<'ctx, F>

§

impl<'ctx, F> Unpin for JitFunction<'ctx, F>
where F: Unpin,

§

impl<'ctx, F> UnwindSafe for JitFunction<'ctx, F>
where F: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.