pub struct BooleanArrayV {
pub array: Arc<BooleanArray<()>>,
pub offset: usize,
/* private fields */
}Expand description
§BooleanArrayView
Borrowed, indexable view into a [offset .. offset + len) window of a
BooleanArray.
§Purpose
- Zero-copy access to contiguous bit-packed boolean values.
- Allows null counts for the view to be cached to speed up scans.
§Fields
array: the backingBooleanArraywrapped inArc.offset: starting index of the view.len: number of logical elements in the view.null_count: cached null count for this range.
§Notes
- Use
sliceto derive smaller views from this one. - Use
to_boolean_arrayto materialise the data.
Fields§
§array: Arc<BooleanArray<()>>The outer array that this view is derived from - we retain a reference to it. Importantly, this is the full array - not the view, and thus should not be accessed as though it were the view subset.
offset: usizeThe index offset from 0 that for where this view starts from the outer array
Implementations§
Source§impl BooleanArrayV
impl BooleanArrayV
Sourcepub fn new(array: Arc<BooleanArray<()>>, offset: usize, len: usize) -> Self
pub fn new(array: Arc<BooleanArray<()>>, offset: usize, len: usize) -> Self
Creates a new BooleanArrayView with the given offset and length.
Sourcepub fn new_nc(
array: Arc<BooleanArray<()>>,
offset: usize,
len: usize,
null_count: usize,
) -> Self
pub fn new_nc( array: Arc<BooleanArray<()>>, offset: usize, len: usize, null_count: usize, ) -> Self
Creates a new BooleanArrayView with a precomputed null count.
Sourcepub fn get_bool(&self, i: usize) -> Option<bool>
pub fn get_bool(&self, i: usize) -> Option<bool>
Returns the value at logical index i as an Option<bool>.
Sourcepub fn slice(&self, offset: usize, len: usize) -> Self
pub fn slice(&self, offset: usize, len: usize) -> Self
Returns a sliced view into a subrange of this view.
Sourcepub fn inner_array(&self) -> Array
pub fn inner_array(&self) -> Array
Returns the full backing array wrapped as an Array enum, ignoring the view’s offset and length.
Use this to access inner array methods. The returned array is the unwindowed original.
Sourcepub fn to_boolean_array(&self) -> Arc<BooleanArray<()>> ⓘ
pub fn to_boolean_array(&self) -> Arc<BooleanArray<()>> ⓘ
Returns an owned BooleanArray for the window.
If the view covers the entire backing array, returns a cheap Arc clone
of the original allocation. Otherwise deep-copies the window via
slice_clone through inner_array.
Sourcepub fn as_tuple(&self) -> (Arc<BooleanArray<()>>, usize, usize)
pub fn as_tuple(&self) -> (Arc<BooleanArray<()>>, usize, usize)
Returns the view as a tuple (array, offset, len).
Sourcepub fn as_tuple_ref(&self) -> (&BooleanArray<()>, usize, usize)
pub fn as_tuple_ref(&self) -> (&BooleanArray<()>, usize, usize)
Returns a reference tuple: (&BooleanArray, offset, len).
This avoids cloning the Arc and returns a reference with a lifetime tied to this BooleanArrayV.
Sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
Returns the number of nulls in the view.
Caches it after the first calculation.
Sourcepub fn has_nulls(&self) -> bool
pub fn has_nulls(&self) -> bool
Returns true when the windowed view holds at least one null.
Reads through null_count, so the cached value is trusted when set
and the full popcount is only paid on the first call that observes
this view.
Sourcepub fn null_mask_view(&self) -> Option<BitmaskV<'_>>
pub fn null_mask_view(&self) -> Option<BitmaskV<'_>>
Returns the null mask as a windowed BitmaskView.
Trait Implementations§
Source§impl Clone for BooleanArrayV
impl Clone for BooleanArrayV
Source§fn clone(&self) -> BooleanArrayV
fn clone(&self) -> BooleanArrayV
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Concatenate for BooleanArrayV
impl Concatenate for BooleanArrayV
Source§fn concat(self, other: Self) -> Result<Self, MinarrowError>
fn concat(self, other: Self) -> Result<Self, MinarrowError>
Concatenates two boolean array views by materialising both to owned boolean arrays, concatenating them, and wrapping the result back in a view.
§Notes
- This operation copies data from both views to create owned boolean arrays.
- The resulting view has offset=0 and length equal to the combined length.
Source§impl Debug for BooleanArrayV
impl Debug for BooleanArrayV
Source§impl Display for BooleanArrayV
impl Display for BooleanArrayV
Source§impl From<Arc<BooleanArray<()>>> for BooleanArrayV
impl From<Arc<BooleanArray<()>>> for BooleanArrayV
Source§impl From<Array> for BooleanArrayV
impl From<Array> for BooleanArrayV
Source§impl From<ArrayV> for BooleanArrayV
impl From<ArrayV> for BooleanArrayV
Source§impl From<BooleanArrayV> for Value
Available on crate feature views only.Wrap a BooleanArrayV as Value::ArrayView. The view’s offset and length
are preserved on the inner ArrayV. The full null mask carried by the
underlying BooleanArray is preserved.
impl From<BooleanArrayV> for Value
views only.Wrap a BooleanArrayV as Value::ArrayView. The view’s offset and length
are preserved on the inner ArrayV. The full null mask carried by the
underlying BooleanArray is preserved.
Source§fn from(v: BooleanArrayV) -> Self
fn from(v: BooleanArrayV) -> Self
Source§impl From<BooleanArrayV> for ArrayV
Available on crate feature views only.BooleanArrayView -> ArrayView
impl From<BooleanArrayV> for ArrayV
views only.BooleanArrayView -> ArrayView
Converts by wrapping the inner Arc
Source§fn from(view: BooleanArrayV) -> Self
fn from(view: BooleanArrayV) -> Self
Source§impl PartialEq for BooleanArrayV
impl PartialEq for BooleanArrayV
Source§impl Shape for BooleanArrayV
impl Shape for BooleanArrayV
impl StructuralPartialEq for BooleanArrayV
Source§impl TryFrom<Value> for BooleanArrayV
Available on crate feature views only.
impl TryFrom<Value> for BooleanArrayV
views only.Source§fn try_from(v: Value) -> Result<Self, Self::Error>
fn try_from(v: Value) -> Result<Self, Self::Error>
Accepts any Value that resolves to an Array carrying a
BooleanArray payload. The conversion routes through ArrayV, so an
incoming view keeps its window instead of materialising it, and every
input Array accepts is accepted here too.
Source§type Error = MinarrowError
type Error = MinarrowError
Auto Trait Implementations§
impl !Freeze for BooleanArrayV
impl RefUnwindSafe for BooleanArrayV
impl Send for BooleanArrayV
impl Sync for BooleanArrayV
impl Unpin for BooleanArrayV
impl UnsafeUnpin for BooleanArrayV
impl UnwindSafe for BooleanArrayV
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CustomValue for T
impl<T> CustomValue for T
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more