Trait geoarrow2::trait_::GeoArrayAccessor
source · pub trait GeoArrayAccessor<'a>: GeometryArrayTrait<'a> {
type Item: Send + Sync + GeometryScalarTrait<'a>;
type ItemGeo: From<Self::Item>;
// Required method
unsafe fn value_unchecked(&'a self, index: usize) -> Self::Item;
// Provided methods
fn value(&'a self, index: usize) -> Self::Item { ... }
fn get(&'a self, index: usize) -> Option<Self::Item> { ... }
fn value_as_geo(&'a self, i: usize) -> Self::ItemGeo { ... }
fn get_as_geo(&'a self, i: usize) -> Option<Self::ItemGeo> { ... }
}
Expand description
A generic trait for accessing the values of an Array
Validity
An [ArrayAccessor
] must always return a well-defined value for an index that is
within the bounds 0..Array::len
, including for null indexes where Array::is_null
is true.
The value at null indexes is unspecified, and implementations must not rely on a specific
value such as Default::default
being returned, however, it must not be undefined
Required Associated Types§
sourcetype Item: Send + Sync + GeometryScalarTrait<'a>
type Item: Send + Sync + GeometryScalarTrait<'a>
The geoarrow scalar object for this geometry array type.
Required Methods§
sourceunsafe fn value_unchecked(&'a self, index: usize) -> Self::Item
unsafe fn value_unchecked(&'a self, index: usize) -> Self::Item
Returns the element at index i
Safety
Caller is responsible for ensuring that the index is within the bounds of the array
Provided Methods§
sourcefn get(&'a self, index: usize) -> Option<Self::Item>
fn get(&'a self, index: usize) -> Option<Self::Item>
Access the value at slot i
as an Arrow scalar, considering validity.
sourcefn value_as_geo(&'a self, i: usize) -> Self::ItemGeo
fn value_as_geo(&'a self, i: usize) -> Self::ItemGeo
Access the value at slot i
as a geo
scalar, not considering validity.
Object Safety§
This trait is not object safe.