Skip to main content

IterGeo

Trait IterGeo 

Source
pub trait IterGeo {
    // Required method
    fn iter_as_wkb_bytes<'a, F: FnMut(Option<&'a [u8]>) -> Result<()>>(
        &'a self,
        sedona_type: &SedonaType,
        num_iterations: usize,
        func: F,
    ) -> Result<()>;

    // Provided methods
    fn iter_with_factory<'a, Factory: GeometryFactory, F: FnMut(Option<Factory::Geom<'a>>) -> Result<()>>(
        &'a self,
        factory: &Factory,
        sedona_type: &SedonaType,
        num_iterations: usize,
        func: F,
    ) -> Result<()> { ... }
    fn iter_as_wkb<'a, F: FnMut(Option<Wkb<'a>>) -> Result<()>>(
        &'a self,
        sedona_type: &SedonaType,
        num_iterations: usize,
        func: F,
    ) -> Result<()> { ... }
}
Expand description

Trait for iterating over a container type as geometry scalars

Currently the only scalar type supported is Wkb; however, for future geometry array types it may make sense to offer other scalar types over which to iterate.

Required Methods§

Source

fn iter_as_wkb_bytes<'a, F: FnMut(Option<&'a [u8]>) -> Result<()>>( &'a self, sedona_type: &SedonaType, num_iterations: usize, func: F, ) -> Result<()>

Provided Methods§

Source

fn iter_with_factory<'a, Factory: GeometryFactory, F: FnMut(Option<Factory::Geom<'a>>) -> Result<()>>( &'a self, factory: &Factory, sedona_type: &SedonaType, num_iterations: usize, func: F, ) -> Result<()>

Source

fn iter_as_wkb<'a, F: FnMut(Option<Wkb<'a>>) -> Result<()>>( &'a self, sedona_type: &SedonaType, num_iterations: usize, func: F, ) -> Result<()>

Apply a function for each element of self as an optional Wkb

The function will always be called num_iteration types to support efficient iteration over scalar containers (e.g., so that implementations can parse the Wkb once and reuse the object).

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.

Implementations on Foreign Types§

Source§

impl IterGeo for ArrayRef

Source§

fn iter_as_wkb_bytes<'a, F: FnMut(Option<&'a [u8]>) -> Result<()>>( &'a self, sedona_type: &SedonaType, num_iterations: usize, func: F, ) -> Result<()>

Implementors§