Trait Operations

Source
pub trait Operations: Sized {
    type Output;

    // Provided methods
    fn empty(&self) -> bool { ... }
    fn atomic(&self) -> bool { ... }
    fn intersection(self, _other: Self::Output) -> Self::Output { ... }
    fn union(self, _other: Self::Output) -> Self::Output { ... }
}
Expand description

Operations defined on interval-like things.

Required Associated Types§

Source

type Output

The return type used in implementations.

Provided Methods§

Source

fn empty(&self) -> bool

Returns whether the interval is empty, regardless of it’s actual type.

Source

fn atomic(&self) -> bool

Returns whether the interval is atomic.

Source

fn intersection(self, _other: Self::Output) -> Self::Output

Returns the intersection of two intervals, shorthand for interval & interval.

Source

fn union(self, _other: Self::Output) -> Self::Output

Returns the union of two intervals, shorthand for interval | interval.

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§

Source§

impl<T: Item> Operations for Interval<T>