1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/// Represents a terminal window size.
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Size {
width: usize,
height: usize,
}
impl Size {
/// Create a new instance with a width and height.
#[inline]
#[must_use]
pub const fn new(width: usize, height: usize) -> Self {
Self { width, height }
}
/// Get the width.
#[inline]
#[must_use]
pub const fn width(&self) -> usize {
self.width
}
/// Get the height.
#[inline]
#[must_use]
pub const fn height(&self) -> usize {
self.height
}
}