Struct datafusion_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) -> Self
pub fn new(type_signature: TypeSignature, volatility: Volatility) -> Self
Creates a new Signature from a given type signature and volatility.
sourcepub fn variadic(common_types: Vec<DataType>, volatility: Volatility) -> Self
pub fn variadic(common_types: Vec<DataType>, volatility: Volatility) -> Self
An arbitrary number of arguments with the same type, from those listed in common_types
.
sourcepub fn user_defined(volatility: Volatility) -> Self
pub fn user_defined(volatility: Volatility) -> Self
User-defined coercion rules for the function.
sourcepub fn numeric(arg_count: usize, volatility: Volatility) -> Self
pub fn numeric(arg_count: usize, volatility: Volatility) -> Self
A specified number of numeric arguments
sourcepub fn variadic_any(volatility: Volatility) -> Self
pub fn variadic_any(volatility: Volatility) -> Self
An arbitrary number of arguments of any type.
sourcepub fn uniform(
arg_count: usize,
valid_types: Vec<DataType>,
volatility: Volatility,
) -> Self
pub fn uniform( arg_count: usize, valid_types: Vec<DataType>, volatility: Volatility, ) -> Self
A fixed number of arguments of the same type, from those listed in valid_types
.
sourcepub fn exact(exact_types: Vec<DataType>, volatility: Volatility) -> Self
pub fn exact(exact_types: Vec<DataType>, volatility: Volatility) -> Self
Exactly matches the types in exact_types
, in order.
sourcepub fn any(arg_count: usize, volatility: Volatility) -> Self
pub fn any(arg_count: usize, volatility: Volatility) -> Self
A specified number of arguments of any type
sourcepub fn one_of(
type_signatures: Vec<TypeSignature>,
volatility: Volatility,
) -> Self
pub fn one_of( type_signatures: Vec<TypeSignature>, volatility: Volatility, ) -> Self
Any one of a list of TypeSignatures.
sourcepub fn array_and_element(volatility: Volatility) -> Self
pub fn array_and_element(volatility: Volatility) -> Self
Specialized Signature for ArrayAppend and similar functions
sourcepub fn array_and_element_and_optional_index(volatility: Volatility) -> Self
pub fn array_and_element_and_optional_index(volatility: Volatility) -> Self
Specialized Signature for Array functions with an optional index
sourcepub fn element_and_array(volatility: Volatility) -> Self
pub fn element_and_array(volatility: Volatility) -> Self
Specialized Signature for ArrayPrepend and similar functions
sourcepub fn array_and_index(volatility: Volatility) -> Self
pub fn array_and_index(volatility: Volatility) -> Self
Specialized Signature for ArrayElement and similar functions
sourcepub fn array(volatility: Volatility) -> Self
pub fn array(volatility: Volatility) -> Self
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.