#[repr(C)]pub struct JITClosure {
pub function_id: u16,
pub captures_count: u16,
pub captures_ptr: *const u64,
}Expand description
JIT-compatible closure structure Holds function_id and a pointer to a heap-allocated array of captured values. Supports unlimited captures (no fixed-size limit).
Fields§
§function_id: u16§captures_count: u16§captures_ptr: *const u64Implementations§
Source§impl JITClosure
impl JITClosure
Sourcepub fn new(function_id: u16, captures: &[u64]) -> Box<Self>
pub fn new(function_id: u16, captures: &[u64]) -> Box<Self>
Create a new JITClosure with dynamically allocated captures.
The captures slice is copied into a heap-allocated Box<[u64]> that is
leaked into a raw pointer. Call drop_captures() to reclaim the memory.
Sourcepub unsafe fn get_capture(&self, index: usize) -> u64
pub unsafe fn get_capture(&self, index: usize) -> u64
Safely read a capture value by index.
§Safety
The captures_ptr must be valid and index must be < captures_count.
Sourcepub unsafe fn drop_captures(&mut self)
pub unsafe fn drop_captures(&mut self)
Free the heap-allocated captures array.
Idempotent: safe to call multiple times (no-op after first call).
§Safety
The captures_ptr must point to a valid allocation created by new(),
or be null (no-op).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JITClosure
impl RefUnwindSafe for JITClosure
impl !Send for JITClosure
impl !Sync for JITClosure
impl Unpin for JITClosure
impl UnsafeUnpin for JITClosure
impl UnwindSafe for JITClosure
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more