Skip to main content

JitArray

Struct JitArray 

Source
#[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 u64

Pointer to boxed element buffer (heap-allocated)

§len: u64

Number of elements currently stored

§cap: u64

Allocated capacity (number of u64 elements)

§typed_data: *mut u64

Optional raw typed payload buffer (mirrors data indices)

§element_kind: u8

ArrayElementKind as byte

§typed_storage_kind: u8

Allocation layout backing typed_data (tracks bool bitset vs 8-byte lanes).

§_padding: [u8; 6]

Keep struct alignment stable and explicit.

Implementations§

Source§

impl JitArray

Source

pub fn new() -> Self

Create an empty array.

Source

pub fn with_capacity(cap: usize) -> Self

Create an array with pre-allocated capacity.

Source

pub fn from_slice(elements: &[u64]) -> Self

Create an array by copying from a slice.

Source

pub fn from_vec(vec: Vec<u64>) -> Self

Create an array from an owned Vec<u64> (takes ownership of the data).

Source

pub fn element_kind(&self) -> ArrayElementKind

Source

pub fn typed_data_ptr(&self) -> *const u64

Source

pub fn len(&self) -> usize

Number of elements.

Source

pub fn is_empty(&self) -> bool

Check if empty.

Source

pub fn as_slice(&self) -> &[u64]

View elements as a slice.

Source

pub fn as_mut_slice(&mut self) -> &mut [u64]

View elements as a mutable slice.

Source

pub fn get(&self, index: usize) -> Option<&u64>

Get element by index (bounds-checked).

Source

pub fn set_boxed(&mut self, index: usize, value: u64) -> bool

Set an element by index (bounds-checked). Returns true when the write succeeded.

Source

pub fn push(&mut self, value: u64)

Push an element (amortized O(1) with doubling growth).

Source

pub fn reserve(&mut self, min_capacity: usize)

Ensure capacity is at least min_capacity elements.

Source

pub fn pop(&mut self) -> Option<u64>

Pop the last element.

Source

pub fn iter(&self) -> Iter<'_, u64>

Iterate over elements.

Source

pub fn first(&self) -> Option<&u64>

Get first element.

Source

pub fn last(&self) -> Option<&u64>

Get last element.

Source

pub fn clone_data(&self) -> Self

Deep copy of element buffer.

Source

pub fn into_vec(self) -> Vec<u64>

Convert to Vec for interop with remaining Rust code paths.

Source

pub fn as_ptr(&self) -> *const u64

Raw pointer to data buffer (for JIT inline access).

Trait Implementations§

Source§

impl Drop for JitArray

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Index<usize> for JitArray

Source§

type Output = u64

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &u64

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for JitArray

Source§

fn index_mut(&mut self, index: usize) -> &mut u64

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more