pub trait BoundingUnion<T>
where 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>> for Option<T>
where T: BoundingUnion<Option<T>, Output = T> + Clone,

§

type Output = Option<T>

source§

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

source§

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

§

type Output = T

source§

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

Implementors§

source§

impl BoundingUnion<Rect> for Rect

§

type Output = Rect

source§

impl BoundingUnion<Span> for Span

§

type Output = Span

source§

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

§

type Output = T

source§

impl<T> BoundingUnion<T> for substrate::geometry::shape::Shape
where T: Bbox,

source§

impl<T: Bbox> BoundingUnion<T> for IoShape

§

type Output = Rect

source§

impl<T: Bbox> BoundingUnion<T> for substrate::layout::element::Shape

§

type Output = Rect