Skip to main content

FunctionSet

Struct FunctionSet 

Source
pub struct FunctionSet { /* private fields */ }
Expand description

Helper for managing groups of functions

Sedona coordinates the assembly of a large number of spatial functions with potentially different sets of dependencies (e.g., geography vs. geometry), multiple implementations, and/or implementations that live in different crates. This structure helps coordinate these implementations.

Implementations§

Source§

impl FunctionSet

Source

pub fn new() -> Self

Create a new, empty FunctionSet

Source

pub fn scalar_udfs(&self) -> impl Iterator<Item = &SedonaScalarUDF> + '_

Iterate over references to all SedonaScalarUDFs

Source

pub fn scalar_udf(&self, name: &str) -> Option<&SedonaScalarUDF>

Return a reference to the function corresponding to the name

Source

pub fn scalar_udf_mut(&mut self, name: &str) -> Option<&mut SedonaScalarUDF>

Return a mutable reference to the function corresponding to the name

Source

pub fn insert_scalar_udf( &mut self, udf: SedonaScalarUDF, ) -> Option<SedonaScalarUDF>

Insert a new ScalarUDF and return the UDF that had previously been added, if any

Source

pub fn aggregate_udfs(&self) -> impl Iterator<Item = &SedonaAggregateUDF> + '_

Iterate over references to all SedonaAggregateUDFs

Source

pub fn aggregate_udf(&self, name: &str) -> Option<&SedonaAggregateUDF>

Return a reference to the aggregate function corresponding to the name

Source

pub fn aggregate_udf_mut( &mut self, name: &str, ) -> Option<&mut SedonaAggregateUDF>

Return a mutable reference to the aggregate function corresponding to the name

Source

pub fn insert_aggregate_udf( &mut self, udf: SedonaAggregateUDF, ) -> Option<SedonaAggregateUDF>

Insert a new AggregateUDF and return the UDF that had previously been added, if any

Source

pub fn merge(&mut self, other: FunctionSet)

Consume another function set and merge its contents into this one

Source

pub fn add_scalar_udf_impl( &mut self, name: &str, kernels: impl IntoScalarKernelRefs, ) -> Result<&SedonaScalarUDF>

Add a kernel to a function in this set

This adds a scalar UDF with immutable output if a function of that name does not exist in this set. A reference to the matching or inserted function is returned.

Source

pub fn add_aggregate_udf_kernel( &mut self, name: &str, kernel: impl IntoSedonaAccumulatorRefs, ) -> Result<&SedonaAggregateUDF>

Add an aggregate kernel to a function in this set

This adds an aggregate UDF with immutable output if a function of that name does not exist in this set. A reference to the matching or inserted function is returned.

Trait Implementations§

Source§

impl Default for FunctionSet

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V