pub struct Function {
pub name: String,
pub params: Vec<Param>,
pub returns: Option<Type>,
pub async: bool,
}Expand description
A single host function exposed to Python.
Fields§
§name: StringFunction name; must be a valid ASCII identifier and must not be one
of the reserved __async_* control names.
params: Vec<Param>Typed parameters, in call order.
returns: Option<Type>Return type, or None for a void function.
async: boolWhether the function is asynchronous. Async functions must currently
return Type::String; at the WASM level they return an i64 token
that the guest resolves to an awaitable via boomslang_host.asyncio.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
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 StructuralPartialEq for Function
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