StructView

Trait StructView 

Source
pub trait StructView: Record + Sized {
    type View<'a>;

    // Required methods
    fn view_at(
        array: &StructArray,
        index: usize,
    ) -> Result<Self::View<'_>, ViewAccessError>;
    fn is_null_at(array: &StructArray, index: usize) -> bool;
}
Expand description

Trait for creating a view from a StructArray at a specific index.

This is automatically implemented by #[derive(Record)] and used internally to support nested struct views.

Required Associated Types§

Source

type View<'a>

The view type for this struct with borrowed references.

Required Methods§

Source

fn view_at( array: &StructArray, index: usize, ) -> Result<Self::View<'_>, ViewAccessError>

Extract a view at the given index from a StructArray.

§Errors

Returns ViewAccessError if the index is out of bounds, the value is null when expected to be non-null, or if there’s a type mismatch during field extraction.

Source

fn is_null_at(array: &StructArray, index: usize) -> bool

Check if the struct value at the given index is null.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§