pub struct CustomFunctionRegistry { /* private fields */ }Expand description
自定义函数注册表
Implementations§
Source§impl CustomFunctionRegistry
impl CustomFunctionRegistry
Sourcepub fn register_function(
name: String,
signature: FunctionSignature,
executor: CustomFunctionExecutor,
) -> Result<(), String>
pub fn register_function( name: String, signature: FunctionSignature, executor: CustomFunctionExecutor, ) -> Result<(), String>
注册自定义函数
Sourcepub fn get_definition(name: &str) -> Option<Rc<dyn FunctionDefinition>>
pub fn get_definition(name: &str) -> Option<Rc<dyn FunctionDefinition>>
获取函数定义
Sourcepub fn is_registered(name: &str) -> bool
pub fn is_registered(name: &str) -> bool
检查函数是否已注册
Sourcepub fn set_current_state(state: Option<Arc<State>>)
pub fn set_current_state(state: Option<Arc<State>>)
设置当前State上下文
Sourcepub fn has_current_state() -> bool
pub fn has_current_state() -> bool
检查当前是否有活跃的State
Sourcepub fn list_functions() -> Vec<String>
pub fn list_functions() -> Vec<String>
列出所有已注册的函数
Auto Trait Implementations§
impl Freeze for CustomFunctionRegistry
impl !RefUnwindSafe for CustomFunctionRegistry
impl !Send for CustomFunctionRegistry
impl !Sync for CustomFunctionRegistry
impl Unpin for CustomFunctionRegistry
impl !UnwindSafe for CustomFunctionRegistry
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
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