pub struct NativeFn {
pub name: String,
pub func: Box<NativeFnInner>,
pub payload: Option<Rc<dyn Any>>,
}Fields§
§name: String§func: Box<NativeFnInner>§payload: Option<Rc<dyn Any>>Implementations§
Source§impl NativeFn
impl NativeFn
pub fn simple( name: impl Into<String>, f: impl Fn(&[Value]) -> Result<Value, SemaError> + 'static, ) -> Self
pub fn with_ctx( name: impl Into<String>, f: impl Fn(&EvalContext, &[Value]) -> Result<Value, SemaError> + 'static, ) -> Self
pub fn with_payload( name: impl Into<String>, payload: Rc<dyn Any>, f: impl Fn(&EvalContext, &[Value]) -> Result<Value, SemaError> + 'static, ) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NativeFn
impl !RefUnwindSafe for NativeFn
impl !Send for NativeFn
impl !Sync for NativeFn
impl Unpin for NativeFn
impl UnsafeUnpin for NativeFn
impl !UnwindSafe for NativeFn
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