Trait puffin::algebra::dynamic_function::DescribableFunction
source · 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§
fn name(&'static self) -> &'static str
fn shape() -> DynamicFunctionShape<PT>
fn make_dynamic(&'static self) -> Box<dyn DynamicFunction<PT>>
Object Safety§
This trait is not object safe.