Trait Sample

Source
pub trait Sample {
    type Value;

    // Required method
    fn sample(&self, rational: Rational) -> Self::Value;
}
Expand description

Types that can be sampled with a rational to produce a value.

Useful for representing continuous functions.

Required Associated Types§

Source

type Value

The type of value returned when sampled.

Required Methods§

Source

fn sample(&self, rational: Rational) -> Self::Value

Sample self with rational to produce a value.

Implementors§

Source§

impl<F, T> Sample for F
where F: Fn(Rational) -> T,

Source§

type Value = T