pub struct ExternalFn {
pub name: String,
pub language: Language,
pub body: String,
pub arg_types: Vec<ValueType>,
pub return_type: ValueType,
pub pure: bool,
}Expand description
A registered external function: everything needed to type-check a call and
(via the improv_extfn runtime) invoke it deterministically.
body is the function body (statements), evaluated with the arguments
bound and expected to produce a result (the runtime defines the exact
contract).
Fields§
§name: String§language: Language§body: String§arg_types: Vec<ValueType>Declared argument types, in order. arity() == arg_types.len().
return_type: ValueType§pure: boolThe author asserts the body is pure (deterministic, no engine-observable side effects). Enforcement beyond the runtime’s isolated invocation is future work.
Implementations§
Trait Implementations§
Source§impl Clone for ExternalFn
impl Clone for ExternalFn
Source§fn clone(&self) -> ExternalFn
fn clone(&self) -> ExternalFn
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExternalFn
impl Debug for ExternalFn
Source§impl<'de> Deserialize<'de> for ExternalFn
impl<'de> Deserialize<'de> for ExternalFn
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ExternalFn
Source§impl PartialEq for ExternalFn
impl PartialEq for ExternalFn
Source§impl Serialize for ExternalFn
impl Serialize for ExternalFn
impl StructuralPartialEq for ExternalFn
Auto Trait Implementations§
impl Freeze for ExternalFn
impl RefUnwindSafe for ExternalFn
impl Send for ExternalFn
impl Sync for ExternalFn
impl Unpin for ExternalFn
impl UnsafeUnpin for ExternalFn
impl UnwindSafe for ExternalFn
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