pub struct Rect {
pub x: u16,
pub y: u16,
pub width: u16,
pub height: u16,
}Expand description
A rectangular area in terminal coordinates.
All positions are zero-indexed. The top-left of the terminal is (0, 0).
Fields§
§x: u16§y: u16§width: u16§height: u16Implementations§
Source§impl Rect
impl Rect
pub const ZERO: Rect
pub const fn new(x: u16, y: u16, width: u16, height: u16) -> Self
Sourcepub fn intersection(&self, other: Rect) -> Rect
pub fn intersection(&self, other: Rect) -> Rect
Returns the intersection of two rectangles.
Sourcepub fn inner(&self, margin: Margin) -> Rect
pub fn inner(&self, margin: Margin) -> Rect
Create a new rect with uniform inner margin applied.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rect
impl<'de> Deserialize<'de> for Rect
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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