Struct terminal2::TerminalSize
source · pub struct TerminalSize {
pub cell_width: Pixels,
pub line_height: Pixels,
pub size: Size<Pixels>,
}
Fields§
§cell_width: Pixels
§line_height: Pixels
§size: Size<Pixels>
Implementations§
source§impl TerminalSize
impl TerminalSize
pub fn new(line_height: Pixels, cell_width: Pixels, size: Size<Pixels>) -> Self
pub fn num_lines(&self) -> usize
pub fn num_columns(&self) -> usize
pub fn height(&self) -> Pixels
pub fn width(&self) -> Pixels
pub fn cell_width(&self) -> Pixels
pub fn line_height(&self) -> Pixels
Trait Implementations§
source§impl Clone for TerminalSize
impl Clone for TerminalSize
source§fn clone(&self) -> TerminalSize
fn clone(&self) -> TerminalSize
Returns a copy of the value. Read more
1.0.0 · 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 Default for TerminalSize
impl Default for TerminalSize
source§impl<'de> Deserialize<'de> for TerminalSize
impl<'de> Deserialize<'de> for TerminalSize
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Dimensions for TerminalSize
impl Dimensions for TerminalSize
source§fn total_lines(&self) -> usize
fn total_lines(&self) -> usize
Note: this is supposed to be for the back buffer’s length, but we exclusively use it to resize the terminal, which does not use this method. We still have to implement it for the trait though, hence, this comment.
source§fn screen_lines(&self) -> usize
fn screen_lines(&self) -> usize
Height of the viewport in lines.
§fn last_column(&self) -> Column
fn last_column(&self) -> Column
Index for the last column.
§fn topmost_line(&self) -> Line
fn topmost_line(&self) -> Line
Line farthest up in the grid history.
§fn bottommost_line(&self) -> Line
fn bottommost_line(&self) -> Line
Line farthest down in the grid history.
§fn history_size(&self) -> usize
fn history_size(&self) -> usize
Number of invisible lines part of the scrollback history.
source§impl From<TerminalSize> for WindowSize
impl From<TerminalSize> for WindowSize
source§fn from(val: TerminalSize) -> Self
fn from(val: TerminalSize) -> Self
Converts to this type from the input type.
source§impl Serialize for TerminalSize
impl Serialize for TerminalSize
impl Copy for TerminalSize
Auto Trait Implementations§
impl RefUnwindSafe for TerminalSize
impl Send for TerminalSize
impl Sync for TerminalSize
impl Unpin 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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ResetDiscriminant<T> for Twhere
T: Copy,
impl<T> ResetDiscriminant<T> for Twhere T: Copy,
§fn discriminant(&self) -> T
fn discriminant(&self) -> T
Value based on which equality for the reset will be determined.