pub struct ItemCrsKernel { /* private fields */ }Expand description
Wrap a SedonaScalarKernel to provide Item CRS type support
Most kernels that operate on geometry or geography in some way can also support Item CRS inputs:
- Functions that return a non-spatial type whose value does not
depend on the input CRS only need to operate on the
itemportion of any item_crs input (e.g., ST_Area()). - Functions that accept two or more spatial arguments must have compatible CRSes.
- Functions that return a geometry or geography must also return an item_crs type where the output CRSes are propagated from the input.
This kernel provides an automatic wrapper enforcing these rules. It is appropriate for most functions except:
- Functions whose return value depends on the CRS
- Functions whose return value depends on the value of a scalar argument
- Functions whose return CRS is not strictly propagated from the CRSes of the arguments.
Implementations§
Source§impl ItemCrsKernel
impl ItemCrsKernel
Sourcepub fn new_ref(inner: ScalarKernelRef) -> ScalarKernelRef
pub fn new_ref(inner: ScalarKernelRef) -> ScalarKernelRef
Create a new ScalarKernelRef wrapping the input
The resulting kernel matches arguments of the input with ItemCrs inputs but not those of the original kernel (i.e., a function needs both kernels to support both type-level and item-level CRSes).
Sourcepub fn wrap_impl(inner: impl IntoScalarKernelRefs) -> Vec<ScalarKernelRef> ⓘ
pub fn wrap_impl(inner: impl IntoScalarKernelRefs) -> Vec<ScalarKernelRef> ⓘ
Wrap a vector of kernels by appending all ItemCrs versions followed by the contents of inner
This is the recommended way to add kernels when all of them should support ItemCrs inputs.
Trait Implementations§
Source§impl Debug for ItemCrsKernel
impl Debug for ItemCrsKernel
Source§impl SedonaScalarKernel for ItemCrsKernel
impl SedonaScalarKernel for ItemCrsKernel
Source§fn return_type(&self, args: &[SedonaType]) -> Result<Option<SedonaType>>
fn return_type(&self, args: &[SedonaType]) -> Result<Option<SedonaType>>
Calculate a return type given input types Read more
fn invoke_batch_from_args( &self, arg_types: &[SedonaType], args: &[ColumnarValue], return_type: &SedonaType, num_rows: usize, config_options: Option<&ConfigOptions>, ) -> Result<ColumnarValue>
Source§fn invoke_batch(
&self,
_arg_types: &[SedonaType],
_args: &[ColumnarValue],
) -> Result<ColumnarValue>
fn invoke_batch( &self, _arg_types: &[SedonaType], _args: &[ColumnarValue], ) -> Result<ColumnarValue>
Compute a batch of results Read more
Source§fn return_type_from_args_and_scalars(
&self,
args: &[SedonaType],
_scalar_args: &[Option<&ScalarValue>],
) -> Result<Option<SedonaType>>
fn return_type_from_args_and_scalars( &self, args: &[SedonaType], _scalar_args: &[Option<&ScalarValue>], ) -> Result<Option<SedonaType>>
Calculate a return type given input type and scalar arguments Read more
Auto Trait Implementations§
impl Freeze for ItemCrsKernel
impl !RefUnwindSafe for ItemCrsKernel
impl Send for ItemCrsKernel
impl Sync for ItemCrsKernel
impl Unpin for ItemCrsKernel
impl UnsafeUnpin for ItemCrsKernel
impl !UnwindSafe for ItemCrsKernel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more