IntervalOrderFor

Trait IntervalOrderFor 

Source
pub trait IntervalOrderFor<T>: IntervalOrder{
    // Required methods
    fn lt(
        &self,
        t: &T,
        i1: &Interval,
        i2: &Interval,
    ) -> Result<bool, IntervalOrderError<T>>;
    fn gt(
        &self,
        t: &T,
        i1: &Interval,
        i2: &Interval,
    ) -> Result<bool, IntervalOrderError<T>>;
    fn get_zero_interval(
        &self,
        t: &T,
    ) -> Result<&Interval, IntervalOrderError<T>>;
    fn get_next_interval<'a>(
        &'a self,
        t: &T,
        i: &Interval,
    ) -> Result<Option<&'a Interval>, IntervalOrderError<T>>;
    fn get_previous_interval<'a>(
        &'a self,
        var: &T,
        i: &Interval,
    ) -> Result<Option<&'a Interval>, IntervalOrderError<T>>;
    fn get_all_intervals_of_t(
        &self,
        t: &T,
    ) -> Result<&Vec<Interval>, IntervalOrderError<T>>;
    fn get_number_of_intervals(
        &self,
        t: &T,
    ) -> Result<usize, IntervalOrderError<T>>;
    fn compute_enabled_intervals_of_threshold(
        &self,
        t: &T,
        thr: &ThresholdConstraint,
    ) -> Result<Vec<Interval>, IntervalOrderError<T>>;
    fn check_interval_replaced(&self, ib: IntervalBoundary) -> IntervalBoundary;
}
Expand description

Trait for types that define an order among intervals

This trait is implemented by types that define an order among intervals. This trait provides functions to access the order, e.g., to check if one interval is before another in the order, get the next interval, etc.

Required Methods§

Source

fn lt( &self, t: &T, i1: &Interval, i2: &Interval, ) -> Result<bool, IntervalOrderError<T>>

Check if in the interval order for t the intervals are ordered i1 < i2

Return true if i1 is before i2 in the order, false otherwise.

The function returns an error if the t is not found, or any of the intervals i1, i2 do not appear in the interval order for t

Source

fn gt( &self, t: &T, i1: &Interval, i2: &Interval, ) -> Result<bool, IntervalOrderError<T>>

Check if in the interval order for t it holds that i1 > i2

Return true if i1 appears after i2 in the order, false otherwise.

The function returns an error if the t is not found, or any of the intervals i1, i2 do not appear in the interval order for t.

Source

fn get_zero_interval(&self, t: &T) -> Result<&Interval, IntervalOrderError<T>>

Get the zero interval of t

Source

fn get_next_interval<'a>( &'a self, t: &T, i: &Interval, ) -> Result<Option<&'a Interval>, IntervalOrderError<T>>

Get the next interval appearing after i in the order for t

Return None if i is the last interval, or i is not in the order for var

Source

fn get_previous_interval<'a>( &'a self, var: &T, i: &Interval, ) -> Result<Option<&'a Interval>, IntervalOrderError<T>>

Get the previous interval of i for variable var

Return None if i is the first interval, or i is not in the order for var

Source

fn get_all_intervals_of_t( &self, t: &T, ) -> Result<&Vec<Interval>, IntervalOrderError<T>>

Get all intervals associated with t

Return an error if the variable t is not found in the interval order, otherwise returns the intervals associated with t

Source

fn get_number_of_intervals(&self, t: &T) -> Result<usize, IntervalOrderError<T>>

Get the number of intervals associated with t

Source

fn compute_enabled_intervals_of_threshold( &self, t: &T, thr: &ThresholdConstraint, ) -> Result<Vec<Interval>, IntervalOrderError<T>>

Get the intervals of t where thr is enabled

Source

fn check_interval_replaced(&self, ib: IntervalBoundary) -> IntervalBoundary

Check whether the interval order replaces the interval boundary

This method checks if the interval boundary ib is replaced by the interval order. If the interval boundary is replaced, the method returns the new interval boundary that replaces ib. If the interval boundary is not replaced, the method returns the original interval boundary.

An interval might have been replaced if the interval boundary is considered equal to another boundary in the order.

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§