Trait AsFunctionTunable

Source
pub trait AsFunctionTunable<Marker>:
    Sized
    + Send
    + Sync
    + 'static {
    type Inputs: Clone;
    type Output;

    // Required method
    fn execute(&self, inputs: Self::Inputs) -> Self::Output;

    // Provided methods
    fn ok(self) -> FunctionTunableResultMap<Self, Marker> { ... }
    fn name(&self) -> &str { ... }
}
Expand description

A function that can be turned into a tunable.

§Marker

The marker generic is used to work around limitations in the trait resolver that causes conflicting implementation errors.

Required Associated Types§

Source

type Inputs: Clone

Function inputs

Source

type Output

Function output

Required Methods§

Source

fn execute(&self, inputs: Self::Inputs) -> Self::Output

Run a tuneable function

Provided Methods§

Source

fn ok(self) -> FunctionTunableResultMap<Self, Marker>

Wrap infallible tunable with Ok

Source

fn name(&self) -> &str

The name of the tuneable function

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Out: 'static, Func> AsFunctionTunable<fn() -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn() -> Out,

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static> AsFunctionTunable<fn(I0) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0) -> Out,

Source§

type Inputs = I0

Source§

type Output = Out

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static, I1: Clone + Send + 'static> AsFunctionTunable<fn(I0, I1) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0, I1) -> Out,

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static, I1: Clone + Send + 'static, I2: Clone + Send + 'static> AsFunctionTunable<fn(I0, I1, I2) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0, I1, I2) -> Out,

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static, I1: Clone + Send + 'static, I2: Clone + Send + 'static, I3: Clone + Send + 'static> AsFunctionTunable<fn(I0, I1, I2, I3) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0, I1, I2, I3) -> Out,

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static, I1: Clone + Send + 'static, I2: Clone + Send + 'static, I3: Clone + Send + 'static, I4: Clone + Send + 'static> AsFunctionTunable<fn(I0, I1, I2, I3, I4) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0, I1, I2, I3, I4) -> Out,

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static, I1: Clone + Send + 'static, I2: Clone + Send + 'static, I3: Clone + Send + 'static, I4: Clone + Send + 'static, I5: Clone + Send + 'static> AsFunctionTunable<fn(I0, I1, I2, I3, I4, I5) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0, I1, I2, I3, I4, I5) -> Out,

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static, I1: Clone + Send + 'static, I2: Clone + Send + 'static, I3: Clone + Send + 'static, I4: Clone + Send + 'static, I5: Clone + Send + 'static, I6: Clone + Send + 'static> AsFunctionTunable<fn(I0, I1, I2, I3, I4, I5, I6) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0, I1, I2, I3, I4, I5, I6) -> Out,

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static, I1: Clone + Send + 'static, I2: Clone + Send + 'static, I3: Clone + Send + 'static, I4: Clone + Send + 'static, I5: Clone + Send + 'static, I6: Clone + Send + 'static, I7: Clone + Send + 'static> AsFunctionTunable<fn(I0, I1, I2, I3, I4, I5, I6, I7) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0, I1, I2, I3, I4, I5, I6, I7) -> Out,

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static, I1: Clone + Send + 'static, I2: Clone + Send + 'static, I3: Clone + Send + 'static, I4: Clone + Send + 'static, I5: Clone + Send + 'static, I6: Clone + Send + 'static, I7: Clone + Send + 'static, I8: Clone + Send + 'static> AsFunctionTunable<fn(I0, I1, I2, I3, I4, I5, I6, I7, I8) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0, I1, I2, I3, I4, I5, I6, I7, I8) -> Out,

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static, I1: Clone + Send + 'static, I2: Clone + Send + 'static, I3: Clone + Send + 'static, I4: Clone + Send + 'static, I5: Clone + Send + 'static, I6: Clone + Send + 'static, I7: Clone + Send + 'static, I8: Clone + Send + 'static, I9: Clone + Send + 'static> AsFunctionTunable<fn(I0, I1, I2, I3, I4, I5, I6, I7, I8, I9) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0, I1, I2, I3, I4, I5, I6, I7, I8, I9) -> Out,

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static, I1: Clone + Send + 'static, I2: Clone + Send + 'static, I3: Clone + Send + 'static, I4: Clone + Send + 'static, I5: Clone + Send + 'static, I6: Clone + Send + 'static, I7: Clone + Send + 'static, I8: Clone + Send + 'static, I9: Clone + Send + 'static, I10: Clone + Send + 'static> AsFunctionTunable<fn(I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10) -> Out,

Source§

impl<Out: 'static, Func, I0: Clone + Send + 'static, I1: Clone + Send + 'static, I2: Clone + Send + 'static, I3: Clone + Send + 'static, I4: Clone + Send + 'static, I5: Clone + Send + 'static, I6: Clone + Send + 'static, I7: Clone + Send + 'static, I8: Clone + Send + 'static, I9: Clone + Send + 'static, I10: Clone + Send + 'static, I11: Clone + Send + 'static> AsFunctionTunable<fn(I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a Func: Fn(I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11) -> Out,