pub trait BoundingUnion<T: ?Sized> {
    type Output;

    // Required method
    fn bounding_union(&self, other: &T) -> Self::Output;
}
Expand description

Trait for calculating a shape that bounds the union of two geometric objects.

Required Associated Types§

source

type Output

The type of the output shape representing the bounding union.

Required Methods§

source

fn bounding_union(&self, other: &T) -> Self::Output

Calculates the bounding union of this shape with other.

§Example

let r1 = Rect::from_sides(0, 0, 100, 200);
let r2 = Rect::from_sides(-50, 20, 120, 160);
assert_eq!(r1.bounding_union(&r2), Rect::from_sides(-50, 0, 120, 200));

let r1 = Rect::from_sides(0, 0, 100, 200);
let r2 = None;
assert_eq!(r1.bounding_union(&r2), Rect::from_sides(0, 0, 100, 200));

Implementations on Foreign Types§

source§

impl<T: BoundingUnion<Option<T>, Output = T> + Clone> BoundingUnion<Option<T>> for Option<T>

§

type Output = Option<T>

source§

fn bounding_union(&self, other: &Option<T>) -> Self::Output

source§

impl<T: BoundingUnion<T, Output = T> + Clone> BoundingUnion<T> for Option<T>

§

type Output = T

source§

fn bounding_union(&self, other: &T) -> Self::Output

Implementors§