pub struct MfFunctionDefinition {
pub name: String,
pub signature: FunctionSignature,
pub executor: Box<dyn Fn(&Arguments<'_>, Option<&Arc<dyn Any + Send + Sync>>) -> Result<Variable> + 'static>,
}
Expand description
自定义函数定义
Fields§
§name: String
函数名称
signature: FunctionSignature
函数签名
executor: Box<dyn Fn(&Arguments<'_>, Option<&Arc<dyn Any + Send + Sync>>) -> Result<Variable> + 'static>
执行器
Implementations§
Trait Implementations§
Source§impl FunctionDefinition for MfFunctionDefinition
impl FunctionDefinition for MfFunctionDefinition
fn call(&self, args: Arguments<'_>) -> AnyhowResult<Variable>
fn required_parameters(&self) -> usize
fn optional_parameters(&self) -> usize
fn check_types(&self, args: &[VariableType]) -> FunctionTypecheck
fn param_type(&self, index: usize) -> Option<VariableType>
fn param_type_str(&self, index: usize) -> String
fn return_type(&self) -> VariableType
fn return_type_str(&self) -> String
Auto Trait Implementations§
impl Freeze for MfFunctionDefinition
impl !RefUnwindSafe for MfFunctionDefinition
impl !Send for MfFunctionDefinition
impl !Sync for MfFunctionDefinition
impl Unpin for MfFunctionDefinition
impl !UnwindSafe for MfFunctionDefinition
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