Skip to main content

GeometryFactory

Trait GeometryFactory 

Source
pub trait GeometryFactory: Default {
    type Geom<'a>;

    // Required method
    fn try_from_wkb<'a>(&self, wkb_bytes: &'a [u8]) -> Result<Self::Geom<'a>>;

    // Provided method
    fn try_from_maybe_wkb<'a>(
        &self,
        maybe_wkb_bytes: Option<&'a [u8]>,
    ) -> Result<Option<Self::Geom<'a>>> { ... }
}
Expand description

Factory object to help the GenericExecutor iterate over various concrete geometry objects

Required Associated Types§

Source

type Geom<'a>

The concrete geometry type (e.g., Wkb)

Usually this is some type whose conversion from raw WKB bytes incurs some cost. The lifetime ensure that types that are a “view” of their input ArrayRef or ScalarValue can be used here; however, this type may also own its own data.

Required Methods§

Source

fn try_from_wkb<'a>(&self, wkb_bytes: &'a [u8]) -> Result<Self::Geom<'a>>

Parse bytes of WKB or EWKB into GeometryFactory::Geom

Provided Methods§

Source

fn try_from_maybe_wkb<'a>( &self, maybe_wkb_bytes: Option<&'a [u8]>, ) -> Result<Option<Self::Geom<'a>>>

Helper that calls GeometryFactory::try_from_wkb on an Option<>.

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§