diff options
Diffstat (limited to 'src/display/size.rs')
-rw-r--r-- | src/display/size.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/display/size.rs b/src/display/size.rs new file mode 100644 index 0000000..085c9f4 --- /dev/null +++ b/src/display/size.rs @@ -0,0 +1,29 @@ +/// Represents a terminal window size. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub(crate) struct Size { + width: usize, + height: usize, +} + +impl Size { + /// Create a new instance with a width and height. + #[inline] + #[must_use] + pub(crate) const fn new(width: usize, height: usize) -> Self { + Self { width, height } + } + + /// Get the width. + #[inline] + #[must_use] + pub(crate) const fn width(&self) -> usize { + self.width + } + + /// Get the height. + #[inline] + #[must_use] + pub(crate) const fn height(&self) -> usize { + self.height + } +} |