pub struct NamedCallable<X: GXExt> { /* private fields */ }Implementations§
Source§impl<X: GXExt> NamedCallable<X>
impl<X: GXExt> NamedCallable<X>
Sourcepub async fn update<'a>(
&mut self,
id: ExprId,
v: &'a Value,
) -> Result<Option<&'a Value>>
pub async fn update<'a>( &mut self, id: ExprId, v: &'a Value, ) -> Result<Option<&'a Value>>
Update the named callable function
This method does two things,
- Handle late binding. When the name ref updates to an actual function compile the real call site
- Return Ok(Some(v)) when the called function returns
Sourcepub async fn call(&mut self, args: ValArray) -> Result<()>
pub async fn call(&mut self, args: ValArray) -> Result<()>
Call the lambda with args
Argument types and arity will be checked and an error will be returned
if they are wrong. If you call the function more than once before it
returns there is no guarantee that the returns will arrive in the order
of the calls. There is no guarantee that a function must return. In
order to handle late binding you must keep calling update while
waiting for this method.
While a late bound function is unresolved calls will queue internally in the NamedCallsite and will happen when the function is resolved.
Sourcepub async fn call_unchecked(&mut self, args: ValArray) -> Result<()>
pub async fn call_unchecked(&mut self, args: ValArray) -> Result<()>
call the function with the specified args
Argument types and arity will NOT be checked by this method. If you call
the function more than once before it returns there is no guarantee that
the returns will arrive in the order of the calls. There is no guarantee
that a function must return. In order to handle late binding you must
keep calling update while waiting for this method.
While a late bound function is unresolved calls will queue internally in the NamedCallsite and will happen when the function is resolved.