pub trait GenericProcedure<Cx: Send + Sync> {
// Required methods
fn run<'life0, 'async_trait>(
&'life0 self,
cx: Cx,
data: String,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn specta_type(
&self,
name: Cow<'static, str>,
map: &mut TypeMap,
) -> FunctionDataType;
}
Expand description
A generic procedure. This is required to allow for any procedure
to be used in a [rpc_rs::Module
].
Required Methods§
Sourcefn run<'life0, 'async_trait>(
&'life0 self,
cx: Cx,
data: String,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
cx: Cx,
data: String,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run this procedure with the context and a JSON-encoded string representing the data required.
Sourcefn specta_type(
&self,
name: Cow<'static, str>,
map: &mut TypeMap,
) -> FunctionDataType
fn specta_type( &self, name: Cow<'static, str>, map: &mut TypeMap, ) -> FunctionDataType
Get the FunctionDataType
of this procedure.