pub struct HostFunctionDefinition {
pub function_name: String,
pub parameter_types: Option<Vec<ParameterType>>,
pub return_type: ReturnType,
}
Expand description
The definition of a function exposed from the host to the guest
Fields§
§function_name: String
The function name
parameter_types: Option<Vec<ParameterType>>
The type of the parameter values for the host function call.
return_type: ReturnType
The type of the return value from the host function call
Implementations§
Source§impl HostFunctionDefinition
impl HostFunctionDefinition
Sourcepub fn new(
function_name: String,
parameter_types: Option<Vec<ParameterType>>,
return_type: ReturnType,
) -> Self
pub fn new( function_name: String, parameter_types: Option<Vec<ParameterType>>, return_type: ReturnType, ) -> Self
Create a new HostFunctionDefinition
.
Sourcepub fn verify_equal_parameter_types(
&self,
function_call_parameter_types: &[ParameterType],
) -> Result<()>
pub fn verify_equal_parameter_types( &self, function_call_parameter_types: &[ParameterType], ) -> Result<()>
Verify that the function call has the correct parameter types.
Trait Implementations§
Source§impl Clone for HostFunctionDefinition
impl Clone for HostFunctionDefinition
Source§fn clone(&self) -> HostFunctionDefinition
fn clone(&self) -> HostFunctionDefinition
Returns a duplicate of the value. Read more
1.0.0 · 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 HostFunctionDefinition
impl Debug for HostFunctionDefinition
Source§impl Default for HostFunctionDefinition
impl Default for HostFunctionDefinition
Source§fn default() -> HostFunctionDefinition
fn default() -> HostFunctionDefinition
Returns the “default value” for a type. Read more
Source§impl PartialEq for HostFunctionDefinition
impl PartialEq for HostFunctionDefinition
Source§impl TryFrom<&[u8]> for HostFunctionDefinition
impl TryFrom<&[u8]> for HostFunctionDefinition
impl Eq for HostFunctionDefinition
impl StructuralPartialEq for HostFunctionDefinition
Auto Trait Implementations§
impl Freeze for HostFunctionDefinition
impl RefUnwindSafe for HostFunctionDefinition
impl Send for HostFunctionDefinition
impl Sync for HostFunctionDefinition
impl Unpin for HostFunctionDefinition
impl UnwindSafe for HostFunctionDefinition
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