Enum bean_script::scope::function::Function
source · pub enum Function {
Custom {
body: Rc<PosNode>,
scope_ref: ScopeRef,
},
BuiltIn {
callback: Rc<dyn Fn(Vec<Data>, Option<Function>, ScopeRef) -> Result<Data, Error>>,
},
Variable {
value: Data,
scope_ref: ScopeRef,
name: String,
},
Constant {
value: Data,
},
}
Variants§
Implementations§
source§impl Function
impl Function
pub fn call( &self, args: Vec<Data>, body_fn: Option<Function>, scope: ScopeRef ) -> Result<Data, Error>
pub fn call_scope( &self, args: Vec<Data>, body_fn: Option<Function>, scope: ScopeRef ) -> Result<Data, Error>
pub fn call_from( &self, args: Vec<Data>, body_fn: Option<Function>, scope: ScopeRef, from_scope: Option<ScopeRef> ) -> Result<Data, Error>
pub fn call_direct( &self, args: Vec<Data>, body_fn: Option<Function>, scope: ScopeRef ) -> Result<Data, Error>
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