pub struct FunctionSignature {
pub namespace: &'static str,
pub local_name: &'static str,
pub arity: FunctionArity,
pub param_types: Vec<SequenceType>,
pub return_type: SequenceType,
}Expand description
Function signature describing parameter and return types
Fields§
§namespace: &'static strThe function namespace URI
local_name: &'static strThe 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 FunctionSignature
impl FunctionSignature
Sourcepub fn new(
namespace: &'static str,
local_name: &'static str,
param_types: Vec<SequenceType>,
return_type: SequenceType,
) -> Self
pub fn new( namespace: &'static str, local_name: &'static str, param_types: Vec<SequenceType>, return_type: SequenceType, ) -> Self
Create a new function signature with exact arity
Sourcepub fn variadic(
namespace: &'static str,
local_name: &'static str,
min_args: usize,
param_types: Vec<SequenceType>,
return_type: SequenceType,
) -> Self
pub fn variadic( namespace: &'static str, local_name: &'static str, min_args: usize, param_types: Vec<SequenceType>, return_type: SequenceType, ) -> Self
Create a function signature with variadic arity
Sourcepub fn range(
namespace: &'static str,
local_name: &'static str,
min_args: usize,
max_args: usize,
param_types: Vec<SequenceType>,
return_type: SequenceType,
) -> Self
pub fn range( namespace: &'static str, local_name: &'static 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
Sourcepub fn param_type(&self, index: usize) -> SequenceType
pub fn param_type(&self, index: usize) -> SequenceType
Get the expected type for a parameter at the given index
For variadic functions, if the index exceeds the param_types length, returns the last parameter type (if any) or item()*.
Trait Implementations§
Source§impl Clone for FunctionSignature
impl Clone for FunctionSignature
Source§fn clone(&self) -> FunctionSignature
fn clone(&self) -> FunctionSignature
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 FunctionSignature
impl Debug for FunctionSignature
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 FunctionSignature
impl RefUnwindSafe for FunctionSignature
impl Send for FunctionSignature
impl Sync for FunctionSignature
impl Unpin for FunctionSignature
impl UnsafeUnpin for FunctionSignature
impl UnwindSafe for FunctionSignature
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