pub struct TerminalSize { /* private fields */ }Expand description
A terminal size value made from validated dimensions.
Implementations§
Source§impl TerminalSize
impl TerminalSize
Sourcepub const fn new(width: TerminalWidth, height: TerminalHeight) -> Self
pub const fn new(width: TerminalWidth, height: TerminalHeight) -> Self
Creates a terminal size from validated dimensions.
Sourcepub const fn try_new(
columns: u16,
rows: u16,
) -> Result<Self, TerminalDimensionError>
pub const fn try_new( columns: u16, rows: u16, ) -> Result<Self, TerminalDimensionError>
Creates a terminal size from raw column and row counts.
§Errors
Returns TerminalDimensionError when either dimension is zero.
Sourcepub const fn width(self) -> TerminalWidth
pub const fn width(self) -> TerminalWidth
Returns the validated width.
Sourcepub const fn height(self) -> TerminalHeight
pub const fn height(self) -> TerminalHeight
Returns the validated height.
Trait Implementations§
Source§impl Clone for TerminalSize
impl Clone for TerminalSize
Source§fn clone(&self) -> TerminalSize
fn clone(&self) -> TerminalSize
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TerminalSize
impl Debug for TerminalSize
Source§impl Hash for TerminalSize
impl Hash for TerminalSize
Source§impl PartialEq for TerminalSize
impl PartialEq for TerminalSize
Source§fn eq(&self, other: &TerminalSize) -> bool
fn eq(&self, other: &TerminalSize) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for TerminalSize
impl Eq for TerminalSize
impl StructuralPartialEq for TerminalSize
Auto Trait Implementations§
impl Freeze for TerminalSize
impl RefUnwindSafe for TerminalSize
impl Send for TerminalSize
impl Sync for TerminalSize
impl Unpin for TerminalSize
impl UnsafeUnpin for TerminalSize
impl UnwindSafe for TerminalSize
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