Struct datafusion::logical_expr::Signature
source · pub struct Signature {
pub type_signature: TypeSignature,
pub volatility: Volatility,
}
Expand description
Defines the supported argument types (TypeSignature
) and Volatility
for a function.
DataFusion will automatically coerce (cast) argument types to one of the supported function signatures, if possible.
Fields§
§type_signature: TypeSignature
The data types that the function accepts. See TypeSignature for more information.
volatility: Volatility
The volatility of the function. See Volatility for more information.
Implementations§
source§impl Signature
impl Signature
sourcepub fn new(type_signature: TypeSignature, volatility: Volatility) -> Signature
pub fn new(type_signature: TypeSignature, volatility: Volatility) -> Signature
Creates a new Signature from a given type signature and volatility.
sourcepub fn variadic(
common_types: Vec<DataType>,
volatility: Volatility,
) -> Signature
pub fn variadic( common_types: Vec<DataType>, volatility: Volatility, ) -> Signature
An arbitrary number of arguments with the same type, from those listed in common_types
.
sourcepub fn user_defined(volatility: Volatility) -> Signature
pub fn user_defined(volatility: Volatility) -> Signature
User-defined coercion rules for the function.
sourcepub fn numeric(arg_count: usize, volatility: Volatility) -> Signature
pub fn numeric(arg_count: usize, volatility: Volatility) -> Signature
A specified number of numeric arguments
sourcepub fn variadic_any(volatility: Volatility) -> Signature
pub fn variadic_any(volatility: Volatility) -> Signature
An arbitrary number of arguments of any type.
sourcepub fn uniform(
arg_count: usize,
valid_types: Vec<DataType>,
volatility: Volatility,
) -> Signature
pub fn uniform( arg_count: usize, valid_types: Vec<DataType>, volatility: Volatility, ) -> Signature
A fixed number of arguments of the same type, from those listed in valid_types
.
sourcepub fn exact(exact_types: Vec<DataType>, volatility: Volatility) -> Signature
pub fn exact(exact_types: Vec<DataType>, volatility: Volatility) -> Signature
Exactly matches the types in exact_types
, in order.
sourcepub fn any(arg_count: usize, volatility: Volatility) -> Signature
pub fn any(arg_count: usize, volatility: Volatility) -> Signature
A specified number of arguments of any type
sourcepub fn one_of(
type_signatures: Vec<TypeSignature>,
volatility: Volatility,
) -> Signature
pub fn one_of( type_signatures: Vec<TypeSignature>, volatility: Volatility, ) -> Signature
Any one of a list of TypeSignatures.
sourcepub fn array_and_element(volatility: Volatility) -> Signature
pub fn array_and_element(volatility: Volatility) -> Signature
Specialized Signature for ArrayAppend and similar functions
sourcepub fn array_and_element_and_optional_index(volatility: Volatility) -> Signature
pub fn array_and_element_and_optional_index(volatility: Volatility) -> Signature
Specialized Signature for Array functions with an optional index
sourcepub fn element_and_array(volatility: Volatility) -> Signature
pub fn element_and_array(volatility: Volatility) -> Signature
Specialized Signature for ArrayPrepend and similar functions
sourcepub fn array_and_index(volatility: Volatility) -> Signature
pub fn array_and_index(volatility: Volatility) -> Signature
Specialized Signature for ArrayElement and similar functions
sourcepub fn array(volatility: Volatility) -> Signature
pub fn array(volatility: Volatility) -> Signature
Specialized Signature for ArrayEmpty and similar functions
Trait Implementations§
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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>
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>
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