pub struct GuestFunctionDefinition {
pub function_name: String,
pub parameter_types: Vec<ParameterType>,
pub return_type: ReturnType,
pub function_pointer: usize,
}
Expand description
The definition of a function exposed from the guest to the host
Fields§
§function_name: String
The function name
parameter_types: 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
function_pointer: usize
The function pointer to the guest function
Implementations§
Source§impl GuestFunctionDefinition
impl GuestFunctionDefinition
Sourcepub fn new(
function_name: String,
parameter_types: Vec<ParameterType>,
return_type: ReturnType,
function_pointer: usize,
) -> Self
pub fn new( function_name: String, parameter_types: Vec<ParameterType>, return_type: ReturnType, function_pointer: usize, ) -> Self
Create a new GuestFunctionDefinition
.
Sourcepub fn verify_parameters(&self, parameter_types: &[ParameterType]) -> Result<()>
pub fn verify_parameters(&self, parameter_types: &[ParameterType]) -> Result<()>
Verify that self
has same signature as the provided parameter_types
.
Trait Implementations§
Source§impl Clone for GuestFunctionDefinition
impl Clone for GuestFunctionDefinition
Source§fn clone(&self) -> GuestFunctionDefinition
fn clone(&self) -> GuestFunctionDefinition
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 GuestFunctionDefinition
impl Debug for GuestFunctionDefinition
Source§impl PartialEq for GuestFunctionDefinition
impl PartialEq for GuestFunctionDefinition
impl Eq for GuestFunctionDefinition
impl StructuralPartialEq for GuestFunctionDefinition
Auto Trait Implementations§
impl Freeze for GuestFunctionDefinition
impl RefUnwindSafe for GuestFunctionDefinition
impl Send for GuestFunctionDefinition
impl Sync for GuestFunctionDefinition
impl Unpin for GuestFunctionDefinition
impl UnwindSafe for GuestFunctionDefinition
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