pub struct Rect {
pub top: u16,
pub left: u16,
pub width: u16,
pub height: u16,
}Fields§
§top: u16§left: u16§width: u16§height: u16Implementations§
Source§impl Rect
impl Rect
pub fn new(top: u16, left: u16, width: u16, height: u16) -> Self
pub fn bottom(&self) -> u16
pub fn right(&self) -> u16
pub fn contains(&self, row: u16, col: u16) -> bool
pub fn contains_xy(&self, x: u16, y: u16) -> bool
pub fn area(&self) -> u32
pub fn is_empty(&self) -> bool
pub fn inset(self, amount: u16) -> Rect
pub fn inset_by(self, insets: Insets) -> Rect
pub fn translate(self, rows: i32, cols: i32) -> Rect
pub fn to_grid(self, origin: Rect) -> Rect
pub fn to_local(self, origin: Rect) -> Rect
pub fn intersection(self, other: Rect) -> Rect
pub fn clip_to(self, bounds: Rect) -> Rect
pub fn split_top(self, height: u16) -> (Rect, Rect)
pub fn split_bottom(self, height: u16) -> (Rect, Rect)
pub fn split_left(self, width: u16) -> (Rect, Rect)
pub fn split_right(self, width: u16) -> (Rect, Rect)
pub fn split_y(self, top_height: u16, gap: u16) -> (Rect, Rect)
pub fn split_x(self, left_width: u16, gap: u16) -> (Rect, Rect)
pub fn centered(self, width: u16, height: u16) -> Rect
Trait Implementations§
impl Copy for Rect
impl Eq for Rect
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Freeze for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnsafeUnpin for Rect
impl UnwindSafe for Rect
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