#[repr(C)]pub struct JitArray {
pub data: *mut u64,
pub len: u64,
pub cap: u64,
pub typed_data: *mut u64,
pub element_kind: u8,
pub typed_storage_kind: u8,
pub _padding: [u8; 6],
}Expand description
Native JIT array with guaranteed C-compatible layout.
Fields§
§data: *mut u64Pointer to boxed element buffer (heap-allocated)
len: u64Number of elements currently stored
cap: u64Allocated capacity (number of u64 elements)
typed_data: *mut u64Optional raw typed payload buffer (mirrors data indices)
element_kind: u8ArrayElementKind as byte
typed_storage_kind: u8Allocation layout backing typed_data (tracks bool bitset vs 8-byte lanes).
_padding: [u8; 6]Keep struct alignment stable and explicit.
Implementations§
Source§impl JitArray
impl JitArray
Sourcepub fn with_capacity(cap: usize) -> Self
pub fn with_capacity(cap: usize) -> Self
Create an array with pre-allocated capacity.
Sourcepub fn from_slice(elements: &[u64]) -> Self
pub fn from_slice(elements: &[u64]) -> Self
Create an array by copying from a slice.
Sourcepub fn from_vec(vec: Vec<u64>) -> Self
pub fn from_vec(vec: Vec<u64>) -> Self
Create an array from an owned Vec<u64> (takes ownership of the data).
pub fn element_kind(&self) -> ArrayElementKind
pub fn typed_data_ptr(&self) -> *const u64
Sourcepub fn as_mut_slice(&mut self) -> &mut [u64]
pub fn as_mut_slice(&mut self) -> &mut [u64]
View elements as a mutable slice.
Sourcepub fn set_boxed(&mut self, index: usize, value: u64) -> bool
pub fn set_boxed(&mut self, index: usize, value: u64) -> bool
Set an element by index (bounds-checked). Returns true when the write succeeded.
Sourcepub fn reserve(&mut self, min_capacity: usize)
pub fn reserve(&mut self, min_capacity: usize)
Ensure capacity is at least min_capacity elements.
Sourcepub fn clone_data(&self) -> Self
pub fn clone_data(&self) -> Self
Deep copy of element buffer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JitArray
impl RefUnwindSafe for JitArray
impl !Send for JitArray
impl !Sync for JitArray
impl Unpin for JitArray
impl UnsafeUnpin for JitArray
impl UnwindSafe for JitArray
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