protospec_build/ffi/
transform.rs

1use proc_macro2::TokenStream;
2
3use crate::FFIArgument;
4
5pub type ForeignTransformObj = Box<dyn ForeignTransform + Send + Sync + 'static>;
6
7pub trait ForeignTransform {
8    fn decoding_gen(
9        &self,
10        input_stream: TokenStream,
11        arguments: Vec<TokenStream>,
12        is_async: bool,
13    ) -> TokenStream;
14
15    fn encoding_gen(
16        &self,
17        input_stream: TokenStream,
18        arguments: Vec<TokenStream>,
19        is_async: bool,
20    ) -> TokenStream;
21
22    fn arguments(&self) -> Vec<FFIArgument>;
23}