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§

source

type Item: Send + Sync + GeometryScalarTrait<'a>

The geoarrow scalar object for this geometry array type.

source

type ItemGeo: From<Self::Item>

The geo scalar object for this geometry array type.

Required Methods§

source

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§

source

fn value(&'a self, index: usize) -> Self::Item

Returns the element at index i

Panics

Panics if the value is outside the bounds of the array

source

fn get(&'a self, index: usize) -> Option<Self::Item>

Access the value at slot i as an Arrow scalar, considering validity.

source

fn value_as_geo(&'a self, i: usize) -> Self::ItemGeo

Access the value at slot i as a geo scalar, not considering validity.

source

fn get_as_geo(&'a self, i: usize) -> Option<Self::ItemGeo>

Access the value at slot i as a geo scalar, considering validity.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> GeoArrayAccessor<'a> for CoordBuffer

§

type Item = Coord<'a>

§

type ItemGeo = Coord

source§

impl<'a> GeoArrayAccessor<'a> for InterleavedCoordBuffer

§

type Item = InterleavedCoord<'a>

§

type ItemGeo = Coord

source§

impl<'a> GeoArrayAccessor<'a> for SeparatedCoordBuffer

§

type Item = SeparatedCoord<'a>

§

type ItemGeo = Coord

source§

impl<'a> GeoArrayAccessor<'a> for PointArray

§

type Item = Point<'a>

§

type ItemGeo = Point

source§

impl<'a> GeoArrayAccessor<'a> for RectArray

§

type Item = Rect<'a>

§

type ItemGeo = Rect

source§

impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for GeometryArray<O>

§

type Item = Geometry<'a, O>

§

type ItemGeo = Geometry

source§

impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for WKBArray<O>

§

type Item = WKB<'a, O>

§

type ItemGeo = Geometry

source§

impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for GeometryCollectionArray<O>

§

type Item = GeometryCollection<'a, O>

§

type ItemGeo = GeometryCollection

source§

impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for LineStringArray<O>

§

type Item = LineString<'a, O>

§

type ItemGeo = LineString

source§

impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for MixedGeometryArray<O>

§

type Item = Geometry<'a, O>

§

type ItemGeo = Geometry

source§

impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for MultiLineStringArray<O>

§

type Item = MultiLineString<'a, O>

§

type ItemGeo = MultiLineString

source§

impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for MultiPointArray<O>

§

type Item = MultiPoint<'a, O>

§

type ItemGeo = MultiPoint

source§

impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for MultiPolygonArray<O>

§

type Item = MultiPolygon<'a, O>

§

type ItemGeo = MultiPolygon

source§

impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for PolygonArray<O>

§

type Item = Polygon<'a, O>

§

type ItemGeo = Polygon