protospec_build/ffi/
function.rs

1use proc_macro2::TokenStream;
2
3use crate::{FFIArgumentValue, asg::Type, FFIArgument};
4
5
6
7pub type ForeignFunctionObj = Box<dyn ForeignFunction + Send + Sync + 'static>;
8
9pub trait ForeignFunction {
10    fn arguments(&self) -> Vec<FFIArgument>;
11
12    fn return_type(&self) -> Type;
13
14    fn call(&self, arguments: &[FFIArgumentValue]) -> TokenStream;
15}