Skip to main content

Overlap

Trait Overlap 

Source
pub trait Overlap<T> {
    // Required method
    fn overlaps(&self, other: &T) -> bool;
}
Expand description

Trait for checking whether two values overlap.

§Examples

use physdes::generic::Overlap;

let a: i32 = 42;
let b: i32 = 42;
assert!(a.overlaps(&b));

let a: i32 = 42;
let b: i32 = 24;
assert!(!a.overlaps(&b));

Required Methods§

Source

fn overlaps(&self, other: &T) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Overlap<i32> for i32

Checks if two i32 values are equal.

Two scalars “overlap” iff they are equal: $a \cap b \iff a = b$

§Examples

use physdes::generic::Overlap;

let a: i32 = 42;
let b: i32 = 42;
assert!(a.overlaps(&b));

let a: i32 = 42;
let b: i32 = 24;
assert!(!a.overlaps(&b));
Source§

fn overlaps(&self, other: &i32) -> bool

Checks if two i32 values are equal.

Two scalars “overlap” iff they are equal: $a \cap b \iff a = b$

Implementors§

Source§

impl<T1, T2, U1, U2> Overlap<Point<U1, U2>> for Point<T1, T2>
where T1: Overlap<U1>, T2: Overlap<U2>,

Source§

impl<T: PartialOrd> Overlap<Interval<T>> for Interval<T>

Source§

impl<T: PartialOrd> Overlap<Interval<T>> for T

Source§

impl<T: PartialOrd> Overlap<T> for Interval<T>