pub struct FunctionDefinition {
    pub uri: String,
    pub name: String,
    pub implementations: Vec<FunctionImplementation>,
}
Expand description

This is a rust equivalent of a YAML function definition

We chose to use mirror types here as the YAML schema is still a little loose and we wanted something simpler. The full types can be obtained using the substrait library and serde_yaml.

Fields§

§uri: String

The URI of the function

Note: this is the one field that is not actually present in the YAML but is generally the URI of the YAML itself

§name: String

The name of the function

§implementations: Vec<FunctionImplementation>

The various implementation kernels supported by the function

Implementations§

source§

impl FunctionDefinition

source

pub fn pick_implementation_from_args( &self, args: &[Expression], schema: &SchemaInfo ) -> Result<Option<FunctionImplementation>, SubstraitExprError>

Given input expressions this attempts to find a matching implementation

This is still very experimental and the implementation resolution rules are subject to change.

Currently this looks for an implementation that exactly matches the input expressions’ types. If any of the input types are the unknown type then those arguments are considered matching but the return type is changed to unknown.

Trait Implementations§

source§

impl Clone for FunctionDefinition

source§

fn clone(&self) -> FunctionDefinition

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FunctionDefinition

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.