pub trait Bbox {
// Required method
fn bbox(&self) -> Option<Rect>;
// Provided method
fn bbox_rect(&self) -> Rect { ... }
}
Expand description
A geometric shape that has a bounding box.
§Examples
let rect = Rect::from_sides(0, 0, 100, 200);
assert_eq!(rect.bbox(), Some(Rect::from_sides(0, 0, 100, 200)));
let rect = Rect::from_xy(50, 70);
assert_eq!(rect.bbox(), Some(Rect::from_sides(50, 70, 50, 70)));