pub struct DeclaredScalarFn { /* private fields */ }Expand description
A scalar function declared from Cypher via
uni.plugin.declareFunction.
Holds a parsed Expr body, the declared argument names (in
positional order — same order as the columns passed to
ScalarPluginFn::invoke), and a precomputed FnSignature.
Implementations§
Source§impl DeclaredScalarFn
impl DeclaredScalarFn
Sourcepub fn new(body: Expr, arg_names: Vec<String>, signature: FnSignature) -> Self
pub fn new(body: Expr, arg_names: Vec<String>, signature: FnSignature) -> Self
Construct a declared scalar function.
arg_names must align with the positional arguments — element
0 of arg_names corresponds to column 0 in the invocation’s
args slice.
Sourcepub fn build_signature(
returns: DataType,
args: &[(String, DataType)],
) -> FnSignature
pub fn build_signature( returns: DataType, args: &[(String, DataType)], ) -> FnSignature
Construct a default FnSignature given an Arrow return type
and a list of (name, type) pairs for arguments.
Trait Implementations§
Source§impl Debug for DeclaredScalarFn
impl Debug for DeclaredScalarFn
Source§impl ScalarPluginFn for DeclaredScalarFn
impl ScalarPluginFn for DeclaredScalarFn
Source§fn signature(&self) -> &FnSignature
fn signature(&self) -> &FnSignature
The function’s static signature (arg types, return type, volatility).
Source§fn invoke(
&self,
args: &[ColumnarValue],
rows: usize,
) -> Result<ColumnarValue, FnError>
fn invoke( &self, args: &[ColumnarValue], rows: usize, ) -> Result<ColumnarValue, FnError>
Invoke the function on a batch of inputs. Read more
Auto Trait Implementations§
impl Freeze for DeclaredScalarFn
impl RefUnwindSafe for DeclaredScalarFn
impl Send for DeclaredScalarFn
impl Sync for DeclaredScalarFn
impl Unpin for DeclaredScalarFn
impl UnsafeUnpin for DeclaredScalarFn
impl UnwindSafe for DeclaredScalarFn
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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