pub struct Rect {
pub x: u16,
pub y: u16,
pub width: u16,
pub height: u16,
}Expand description
A rectangular area in the terminal.
Fields§
§x: u16§y: u16§width: u16§height: u16Implementations§
Source§impl Rect
impl Rect
pub const MAX: Self
pub const MIN: Self = Self::ZERO
pub const ZERO: Self
pub const fn new(x: u16, y: u16, width: u16, height: u16) -> Self
pub const fn area(self) -> u32
pub const fn is_empty(self) -> bool
pub const fn left(self) -> u16
pub const fn right(self) -> u16
pub const fn top(self) -> u16
pub const fn bottom(self) -> u16
pub const fn row(self) -> u16
pub const fn col(self) -> u16
pub const fn inner(self, margin: Margin) -> Self
pub const fn outer(self, margin: Margin) -> Self
pub fn offset(self, offset: Offset) -> Self
pub const fn resize(self, size: Size) -> Self
pub fn union(self, other: Self) -> Self
pub fn intersection(self, other: Self) -> Self
pub const fn intersects(self, other: Self) -> bool
pub const fn contains(self, position: Position) -> bool
pub fn clamp(self, other: Self) -> Self
pub const fn rows(self) -> Rows ⓘ
pub const fn columns(self) -> Columns ⓘ
pub const fn positions(self) -> Positions ⓘ
pub const fn as_position(self) -> Position
pub const fn as_size(self) -> Size
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.