pub struct Function {
pub name: String,
pub func: NativeFunction,
pub arity: Arity,
pub params: String,
pub pure: bool,
}Expand description
A wrapper to hold the NativeFunction and its arity.
Fields§
§name: String§func: NativeFunction§arity: Arity§params: String§pure: boolImplementations§
Source§impl Function
impl Function
Sourcepub fn new(func: NativeFunction, arity: Arity, declaration: &str) -> Self
pub fn new(func: NativeFunction, arity: Arity, declaration: &str) -> Self
Creates a new pure Function from a declaration.
Example: “max(left: Number, right: Number): Number”)
§Remarks
If the declaration does not contain an opening brace, the whole string is used as name and the params are left empty.
Sourcepub fn impure(func: NativeFunction, arity: Arity, declaration: &str) -> Self
pub fn impure(func: NativeFunction, arity: Arity, declaration: &str) -> Self
Creates an impure Function.
See also: Function::new
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
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