Trait narrow::Array [−][src]
pub trait Array {
type Validity: ArrayData;
fn validity(&self) -> &Self::Validity;
fn len(&self) -> usize { ... }
fn is_empty(&self) -> bool { ... }
fn null_count(&self) -> usize { ... }
fn any_null(&self) -> bool { ... }
fn all_null(&self) -> bool { ... }
fn is_null(&self, index: usize) -> bool { ... }
fn valid_count(&self) -> usize { ... }
fn any_valid(&self) -> bool { ... }
fn all_valid(&self) -> bool { ... }
fn is_valid(&self, index: usize) -> bool { ... }
}Expand description
A sequence of values with known length all having the same type.
Associated Types
Required methods
Provided methods
Returns the number of elements in the array, also referred to as its length.
Examples
use narrow::{Array, Uint32Array}; let array: Uint32Array<false> = [1, 2, 3, 4].into_iter().collect(); assert_eq!(array.len(), 4);
Returns true if the array contains no elements.
Examples
use narrow::{Array, Uint32Array}; let empty: Uint32Array<false> = [].into_iter().collect(); assert!(empty.is_empty());
fn null_count(&self) -> usize
fn null_count(&self) -> usize
Returns the number of null elements.
Examples
use narrow::{Array, Uint32Array}; let array: Uint32Array<true> = [Some(1), None, Some(3), Some(4)].into_iter().collect(); assert_eq!(array.null_count(), 1);
Returns true if the array contains at least one null element.
Examples
use narrow::{Array, Uint32Array}; let array: Uint32Array<true> = [Some(1), None, Some(3), Some(4)].into_iter().collect(); assert!(array.any_null());
Returns true if all the elements in the array are null.
Examples
use narrow::{Array, Uint32Array}; let array: Uint32Array<true> = [None, None, None, None].into_iter().collect(); assert!(array.all_null());
fn valid_count(&self) -> usize
fn valid_count(&self) -> usize
Returns the number of valid elements.
Examples
use narrow::{Array, Uint32Array}; let array: Uint32Array<true> = [Some(1), None, Some(3), Some(4)].into_iter().collect(); assert_eq!(array.valid_count(), 3);
Returns true if the array contains at least one valid element.
Examples
use narrow::{Array, Uint32Array}; let array: Uint32Array<true> = [Some(1), None, Some(3), Some(4)].into_iter().collect(); assert!(array.any_valid());
Returns true if all the elements in the array are valid.
Examples
use narrow::{Array, Uint32Array}; let array: Uint32Array<true> = [Some(1), Some(2), Some(3), Some(4)].into_iter().collect(); assert!(array.all_valid());