#[non_exhaustive]pub struct Collision {
pub index_a: usize,
pub index_b: usize,
pub overlap_rect: [f32; 4],
pub overlap_area: f32,
}Expand description
A pair of overlapping PlacedBoxes returned by detect_collisions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.index_a: usizeIndex of the first box in the input slice.
index_b: usizeIndex of the second box in the input slice.
overlap_rect: [f32; 4]The intersection rectangle [x, y, width, height].
overlap_area: f32Pre-computed area of overlap_rect in PDF points².
Equals overlap_rect[2] * overlap_rect[3]. Callers can use this directly
without recomputing to decide collision severity.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Collision
impl RefUnwindSafe for Collision
impl Send for Collision
impl Sync for Collision
impl Unpin for Collision
impl UnsafeUnpin for Collision
impl UnwindSafe for Collision
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more