allen-intervals 0.1.0

An efficient implementation of Allen's interval relations for Rust's range types.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::{IntervalError, NonEmpty};

/// Create a value from a pair of intervals.
pub trait FromIntervals<S, T>: Sized {
    /// Creates a value from a pair of intervals.
    fn from_intervals(s: &NonEmpty<S>, t: &NonEmpty<T>) -> Self;
}

/// Create a value from a pair of intervals.
pub trait TryFromIntervals<S, T>: Sized {
    /// Creates a value from a pair of intervals.
    fn try_from_intervals(s: &NonEmpty<S>, t: &NonEmpty<T>) -> Result<Self, IntervalError>;
}