pub struct Size { /* private fields */ }Expand description
Dimensions of a pseudoconsole, in character cells.
A Size is always valid: both dimensions are non-zero and at most
Size::MAX_DIMENSION. Construct one with Size::try_new;
Size::default is 80 columns by 24 rows.
§Examples
use conpty_oxide::Size;
let size = Size::try_new(80, 24)?;
assert_eq!(size.rows(), 24);
assert_eq!(size.cols(), 80);
assert_eq!(size, Size::default());Implementations§
Source§impl Size
impl Size
Sourcepub const MAX_DIMENSION: u16
pub const MAX_DIMENSION: u16
Maximum value for either dimension: i16::MAX (32767).
ConPTY’s COORD stores dimensions as i16, so anything larger cannot
be represented.
Sourcepub const fn try_new(cols: u16, rows: u16) -> Result<Self>
pub const fn try_new(cols: u16, rows: u16) -> Result<Self>
Creates a Size, validating both dimensions.
§Errors
Returns an error with crate::ErrorKind::InvalidSize if either
dimension is 0 or greater than Size::MAX_DIMENSION.
Trait Implementations§
impl Copy for Size
Source§impl Display for Size
Formats as <cols>x<rows> — columns first, matching the conventional
terminal geometry notation (e.g. the default size displays as 80x24).
impl Display for Size
Formats as <cols>x<rows> — columns first, matching the conventional
terminal geometry notation (e.g. the default size displays as 80x24).
impl Eq for Size
impl StructuralPartialEq for Size
Auto Trait Implementations§
impl Freeze for Size
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnsafeUnpin for Size
impl UnwindSafe for Size
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