nyx_space::md

Trait EventEvaluator

source
pub trait EventEvaluator<S: State>:
    Display
    + Send
    + Sync{
    // Required methods
    fn eval(&self, state: &S, almanac: Arc<Almanac>) -> Result<f64, EventError>;
    fn eval_string(
        &self,
        state: &S,
        almanac: Arc<Almanac>,
    ) -> Result<String, EventError>;
    fn epoch_precision(&self) -> Duration;
    fn value_precision(&self) -> f64;

    // Provided method
    fn eval_crossing(
        &self,
        prev_state: &S,
        next_state: &S,
        almanac: Arc<Almanac>,
    ) -> Result<bool, EventError> { ... }
}
Expand description

A trait to specify how a specific event must be evaluated.

Required Methods§

source

fn eval(&self, state: &S, almanac: Arc<Almanac>) -> Result<f64, EventError>

Evaluation of the event, must return a value corresponding to whether the state is before or after the event

source

fn eval_string( &self, state: &S, almanac: Arc<Almanac>, ) -> Result<String, EventError>

Returns a string representation of the event evaluation for the given state

source

fn epoch_precision(&self) -> Duration

source

fn value_precision(&self) -> f64

Provided Methods§

source

fn eval_crossing( &self, prev_state: &S, next_state: &S, almanac: Arc<Almanac>, ) -> Result<bool, EventError>

Implementors§