pub trait DescribableFunction<PT: ProtocolTypes, Types> {
    // Required methods
    fn name(&'static self) -> &'static str;
    fn shape() -> DynamicFunctionShape<PT>;
    fn make_dynamic(&'static self) -> Box<dyn DynamicFunction<PT>>;
}
Expand description

This trait is implemented for function traits in order to:

  • describe their shape during runtime
  • wrap them into a DynamicFunction which is callable with arbitrary data

Adapted from https://jsdw.me/posts/rust-fn-traits/ but using type ids

Required Methods§

source

fn name(&'static self) -> &'static str

source

fn shape() -> DynamicFunctionShape<PT>

source

fn make_dynamic(&'static self) -> Box<dyn DynamicFunction<PT>>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<F, PT: ProtocolTypes, R> DescribableFunction<PT, (R,)> for F
where F: Fn() -> Result<R, FnError> + Send + Sync, R: Send + Sync + EvaluatedTerm<PT> + 'static,

source§

impl<F, PT: ProtocolTypes, R, T1> DescribableFunction<PT, (R, T1)> for F
where F: Fn(&T1) -> Result<R, FnError> + Send + Sync, R: Send + Sync + EvaluatedTerm<PT> + 'static, T1: Send + Sync + 'static,

source§

impl<F, PT: ProtocolTypes, R, T1, T2> DescribableFunction<PT, (R, T1, T2)> for F
where F: Fn(&T1, &T2) -> Result<R, FnError> + Send + Sync, R: Send + Sync + EvaluatedTerm<PT> + 'static, T1: Send + Sync + 'static, T2: Send + Sync + 'static,

source§

impl<F, PT: ProtocolTypes, R, T1, T2, T3> DescribableFunction<PT, (R, T1, T2, T3)> for F
where F: Fn(&T1, &T2, &T3) -> Result<R, FnError> + Send + Sync, R: Send + Sync + EvaluatedTerm<PT> + 'static, T1: Send + Sync + 'static, T2: Send + Sync + 'static, T3: Send + Sync + 'static,

source§

impl<F, PT: ProtocolTypes, R, T1, T2, T3, T4> DescribableFunction<PT, (R, T1, T2, T3, T4)> for F
where F: Fn(&T1, &T2, &T3, &T4) -> Result<R, FnError> + Send + Sync, R: Send + Sync + EvaluatedTerm<PT> + 'static, T1: Send + Sync + 'static, T2: Send + Sync + 'static, T3: Send + Sync + 'static, T4: Send + Sync + 'static,

source§

impl<F, PT: ProtocolTypes, R, T1, T2, T3, T4, T5> DescribableFunction<PT, (R, T1, T2, T3, T4, T5)> for F
where F: Fn(&T1, &T2, &T3, &T4, &T5) -> Result<R, FnError> + Send + Sync, R: Send + Sync + EvaluatedTerm<PT> + 'static, T1: Send + Sync + 'static, T2: Send + Sync + 'static, T3: Send + Sync + 'static, T4: Send + Sync + 'static, T5: Send + Sync + 'static,

source§

impl<F, PT: ProtocolTypes, R, T1, T2, T3, T4, T5, T6> DescribableFunction<PT, (R, T1, T2, T3, T4, T5, T6)> for F
where F: Fn(&T1, &T2, &T3, &T4, &T5, &T6) -> Result<R, FnError> + Send + Sync, R: Send + Sync + EvaluatedTerm<PT> + 'static, T1: Send + Sync + 'static, T2: Send + Sync + 'static, T3: Send + Sync + 'static, T4: Send + Sync + 'static, T5: Send + Sync + 'static, T6: Send + Sync + 'static,

source§

impl<F, PT: ProtocolTypes, R, T1, T2, T3, T4, T5, T6, T7> DescribableFunction<PT, (R, T1, T2, T3, T4, T5, T6, T7)> for F
where F: Fn(&T1, &T2, &T3, &T4, &T5, &T6, &T7) -> Result<R, FnError> + Send + Sync, R: Send + Sync + EvaluatedTerm<PT> + 'static, T1: Send + Sync + 'static, T2: Send + Sync + 'static, T3: Send + Sync + 'static, T4: Send + Sync + 'static, T5: Send + Sync + 'static, T6: Send + Sync + 'static, T7: Send + Sync + 'static,

source§

impl<F, PT: ProtocolTypes, R, T1, T2, T3, T4, T5, T6, T7, T8> DescribableFunction<PT, (R, T1, T2, T3, T4, T5, T6, T7, T8)> for F
where F: Fn(&T1, &T2, &T3, &T4, &T5, &T6, &T7, &T8) -> Result<R, FnError> + Send + Sync, R: Send + Sync + EvaluatedTerm<PT> + 'static, T1: Send + Sync + 'static, T2: Send + Sync + 'static, T3: Send + Sync + 'static, T4: Send + Sync + 'static, T5: Send + Sync + 'static, T6: Send + Sync + 'static, T7: Send + Sync + 'static, T8: Send + Sync + 'static,

source§

impl<F, PT: ProtocolTypes, R, T1, T2, T3, T4, T5, T6, T7, T8, T9> DescribableFunction<PT, (R, T1, T2, T3, T4, T5, T6, T7, T8, T9)> for F
where F: Fn(&T1, &T2, &T3, &T4, &T5, &T6, &T7, &T8, &T9) -> Result<R, FnError> + Send + Sync, R: Send + Sync + EvaluatedTerm<PT> + 'static, T1: Send + Sync + 'static, T2: Send + Sync + 'static, T3: Send + Sync + 'static, T4: Send + Sync + 'static, T5: Send + Sync + 'static, T6: Send + Sync + 'static, T7: Send + Sync + 'static, T8: Send + Sync + 'static, T9: Send + Sync + 'static,