pub struct DynamicFunctionSignature {
pub namespace: Arc<str>,
pub local_name: Arc<str>,
pub arity: FunctionArity,
pub param_types: Vec<SequenceType>,
pub return_type: SequenceType,
}Expand description
Function signature with owned strings for external registration.
Unlike FunctionSignature which uses &'static str for built-in functions,
this type owns its strings, allowing dynamic registration of custom functions.
Fields§
§namespace: Arc<str>The function namespace URI.
local_name: Arc<str>The local name of the function.
arity: FunctionArityThe arity specification.
param_types: Vec<SequenceType>Parameter types (may be shorter than actual args for variadic functions).
return_type: SequenceTypeReturn type.
Implementations§
Source§impl DynamicFunctionSignature
impl DynamicFunctionSignature
Sourcepub fn new(
namespace: impl Into<Arc<str>>,
local_name: impl Into<Arc<str>>,
param_types: Vec<SequenceType>,
return_type: SequenceType,
) -> Self
pub fn new( namespace: impl Into<Arc<str>>, local_name: impl Into<Arc<str>>, param_types: Vec<SequenceType>, return_type: SequenceType, ) -> Self
Create a new dynamic signature with exact arity.
Sourcepub fn variadic(
namespace: impl Into<Arc<str>>,
local_name: impl Into<Arc<str>>,
min_args: usize,
param_types: Vec<SequenceType>,
return_type: SequenceType,
) -> Self
pub fn variadic( namespace: impl Into<Arc<str>>, local_name: impl Into<Arc<str>>, min_args: usize, param_types: Vec<SequenceType>, return_type: SequenceType, ) -> Self
Create a variadic function signature.
Sourcepub fn range(
namespace: impl Into<Arc<str>>,
local_name: impl Into<Arc<str>>,
min_args: usize,
max_args: usize,
param_types: Vec<SequenceType>,
return_type: SequenceType,
) -> Self
pub fn range( namespace: impl Into<Arc<str>>, local_name: impl Into<Arc<str>>, min_args: usize, max_args: usize, param_types: Vec<SequenceType>, return_type: SequenceType, ) -> Self
Create a function signature with range arity.
Sourcepub fn matches_arity(&self, count: usize) -> bool
pub fn matches_arity(&self, count: usize) -> bool
Check if this signature matches the given arity.
Trait Implementations§
Source§impl Clone for DynamicFunctionSignature
impl Clone for DynamicFunctionSignature
Source§fn clone(&self) -> DynamicFunctionSignature
fn clone(&self) -> DynamicFunctionSignature
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DynamicFunctionSignature
impl Debug for DynamicFunctionSignature
Source§impl From<&FunctionSignature> for DynamicFunctionSignature
impl From<&FunctionSignature> for DynamicFunctionSignature
Source§fn from(sig: &FunctionSignature) -> Self
fn from(sig: &FunctionSignature) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DynamicFunctionSignature
impl RefUnwindSafe for DynamicFunctionSignature
impl Send for DynamicFunctionSignature
impl Sync for DynamicFunctionSignature
impl Unpin for DynamicFunctionSignature
impl UnsafeUnpin for DynamicFunctionSignature
impl UnwindSafe for DynamicFunctionSignature
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
Mutably borrows from an owned value. Read more