pub enum ArrayView<'a> {
Generic(&'a Arc<Vec<ValueWord>>),
Int(&'a Arc<TypedBuffer<i64>>),
Float(&'a Arc<AlignedTypedBuffer>),
Bool(&'a Arc<TypedBuffer<u8>>),
I8(&'a Arc<TypedBuffer<i8>>),
I16(&'a Arc<TypedBuffer<i16>>),
I32(&'a Arc<TypedBuffer<i32>>),
U8(&'a Arc<TypedBuffer<u8>>),
U16(&'a Arc<TypedBuffer<u16>>),
U32(&'a Arc<TypedBuffer<u32>>),
U64(&'a Arc<TypedBuffer<u64>>),
F32(&'a Arc<TypedBuffer<f32>>),
}Expand description
Unified read-only view over all array variants (generic, int, float, bool, width-specific).
Returned by ValueWord::as_any_array(). Use typed fast-path methods
(as_f64_slice(), as_i64_slice()) for hot paths, or to_generic()
/ get_nb() for cold paths that need ValueWord values.
Variants§
Generic(&'a Arc<Vec<ValueWord>>)
Int(&'a Arc<TypedBuffer<i64>>)
Float(&'a Arc<AlignedTypedBuffer>)
Bool(&'a Arc<TypedBuffer<u8>>)
I8(&'a Arc<TypedBuffer<i8>>)
I16(&'a Arc<TypedBuffer<i16>>)
I32(&'a Arc<TypedBuffer<i32>>)
U8(&'a Arc<TypedBuffer<u8>>)
U16(&'a Arc<TypedBuffer<u16>>)
U32(&'a Arc<TypedBuffer<u32>>)
U64(&'a Arc<TypedBuffer<u64>>)
F32(&'a Arc<TypedBuffer<f32>>)
Implementations§
Source§impl<'a> ArrayView<'a>
impl<'a> ArrayView<'a>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn get_nb(&self, idx: usize) -> Option<ValueWord>
pub fn get_nb(&self, idx: usize) -> Option<ValueWord>
Get element at index as ValueWord (boxes typed elements — use for cold paths).
pub fn first_nb(&self) -> Option<ValueWord>
pub fn last_nb(&self) -> Option<ValueWord>
Sourcepub fn to_generic(&self) -> Arc<Vec<ValueWord>>
pub fn to_generic(&self) -> Arc<Vec<ValueWord>>
Materialize into a generic ValueWord array. Cheap Arc clone for Generic variant.
pub fn as_i64_slice(&self) -> Option<&[i64]>
pub fn as_f64_slice(&self) -> Option<&[f64]>
pub fn as_bool_slice(&self) -> Option<&[u8]>
pub fn as_generic(&self) -> Option<&Arc<Vec<ValueWord>>>
pub fn iter_i64(&self) -> Option<Iter<'_, i64>>
pub fn iter_f64(&self) -> Option<Iter<'_, f64>>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ArrayView<'a>
impl<'a> RefUnwindSafe for ArrayView<'a>
impl<'a> Send for ArrayView<'a>
impl<'a> Sync for ArrayView<'a>
impl<'a> Unpin for ArrayView<'a>
impl<'a> UnsafeUnpin for ArrayView<'a>
impl<'a> UnwindSafe for ArrayView<'a>
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