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§