pub struct BlockView<'a> { /* private fields */ }Expand description
A borrowed, read-only view of a Block.
Keys are &str references into the original Block’s key strings.
Values are ColumnViews that borrow the underlying array data.
Implementations§
Source§impl<'a> BlockView<'a>
impl<'a> BlockView<'a>
Sourcepub fn insert(&mut self, key: &'a str, col: ColumnView<'a>)
pub fn insert(&mut self, key: &'a str, col: ColumnView<'a>)
Inserts a column view under the given key.
If the BlockView was empty, nrows is set from the column’s axis-0
length. Subsequent insertions are not validated for consistency (caller
is responsible).
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Returns true if the view contains the specified key.
Sourcepub fn get(&self, key: &str) -> Option<&ColumnView<'a>>
pub fn get(&self, key: &str) -> Option<&ColumnView<'a>>
Gets an immutable reference to the column view for key if present.
Sourcepub fn get_float(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&'a f64>, Dim<IxDynImpl>>>
pub fn get_float( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&'a f64>, Dim<IxDynImpl>>>
Gets a float array view for key if present and of correct type.
Sourcepub fn get_int(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&'a i32>, Dim<IxDynImpl>>>
pub fn get_int( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&'a i32>, Dim<IxDynImpl>>>
Gets an int array view for key if present and of correct type.
Sourcepub fn get_bool(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&'a bool>, Dim<IxDynImpl>>>
pub fn get_bool( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&'a bool>, Dim<IxDynImpl>>>
Gets a bool array view for key if present and of correct type.
Sourcepub fn get_uint(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&'a u32>, Dim<IxDynImpl>>>
pub fn get_uint( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&'a u32>, Dim<IxDynImpl>>>
Gets a uint array view for key if present and of correct type.
Sourcepub fn get_u8(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&'a u8>, Dim<IxDynImpl>>>
pub fn get_u8( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&'a u8>, Dim<IxDynImpl>>>
Gets a u8 array view for key if present and of correct type.
Sourcepub fn get_string(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&'a String>, Dim<IxDynImpl>>>
pub fn get_string( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&'a String>, Dim<IxDynImpl>>>
Gets a string array view for key if present and of correct type.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&&'a str, &ColumnView<'a>)>
pub fn iter(&self) -> impl Iterator<Item = (&&'a str, &ColumnView<'a>)>
Returns an iterator over (&str, &ColumnView).
Sourcepub fn values(&self) -> impl Iterator<Item = &ColumnView<'a>>
pub fn values(&self) -> impl Iterator<Item = &ColumnView<'a>>
Returns an iterator over column view references.
Trait Implementations§
Source§impl BlockAccess for BlockView<'_>
impl BlockAccess for BlockView<'_>
Source§fn get_float_view(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&f64>, Dim<IxDynImpl>>>
fn get_float_view( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&f64>, Dim<IxDynImpl>>>
key if present and of correct type.Source§fn get_int_view(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&i32>, Dim<IxDynImpl>>>
fn get_int_view( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&i32>, Dim<IxDynImpl>>>
key if present and of correct type.Source§fn get_bool_view(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&bool>, Dim<IxDynImpl>>>
fn get_bool_view( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&bool>, Dim<IxDynImpl>>>
key if present and of correct type.Source§fn get_uint_view(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&u32>, Dim<IxDynImpl>>>
fn get_uint_view( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&u32>, Dim<IxDynImpl>>>
key if present and of correct type.Source§fn get_u8_view(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&u8>, Dim<IxDynImpl>>>
fn get_u8_view( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&u8>, Dim<IxDynImpl>>>
key if present and of correct type.Source§fn get_string_view(
&self,
key: &str,
) -> Option<ArrayBase<ViewRepr<&String>, Dim<IxDynImpl>>>
fn get_string_view( &self, key: &str, ) -> Option<ArrayBase<ViewRepr<&String>, Dim<IxDynImpl>>>
key if present and of correct type.Source§fn contains_key(&self, key: &str) -> bool
fn contains_key(&self, key: &str) -> bool
true if the block contains the specified key.Source§fn column_keys(&self) -> Vec<&str>
fn column_keys(&self) -> Vec<&str>
Vec.