blob: 3c4652aa93623b6a22c713b45d589f2b32016604 (
plain)
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
|
/// 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.
#[must_use]
pub(crate) const fn new(width: usize, height: usize) -> Self {
Self { width, height }
}
/// Get the width.
#[must_use]
pub(crate) const fn width(&self) -> usize {
self.width
}
/// Get the height.
#[must_use]
pub(crate) const fn height(&self) -> usize {
self.height
}
}
|