pub struct SizeInfo<T = f32> {
width: T,
height: T,
cell_width: T,
cell_height: T,
padding_x: T,
padding_y: T,
screen_lines: usize,
columns: usize,
}
Expand description
Terminal size info.
Fields§
§width: T
Terminal window width.
height: T
Terminal window height.
cell_width: T
Width of individual cell.
cell_height: T
Height of individual cell.
padding_x: T
Horizontal window padding.
padding_y: T
Vertical window padding.
screen_lines: usize
Number of lines in the viewport.
columns: usize
Number of columns in the viewport.
Implementations§
source§impl SizeInfo<f32>
impl SizeInfo<f32>
pub fn new( width: f32, height: f32, cell_width: f32, cell_height: f32, padding_x: f32, padding_y: f32, dynamic_padding: bool ) -> SizeInfo
pub fn reserve_lines(&mut self, count: usize)
sourcepub fn contains_point(&self, x: usize, y: usize) -> bool
pub fn contains_point(&self, x: usize, y: usize) -> bool
Check if coordinates are inside the terminal grid.
The padding, message bar or search are not counted as part of the grid.
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for SizeInfo<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for SizeInfo<T>where T: Deserialize<'de>,
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 SizeInfo
impl Dimensions for SizeInfo
source§fn screen_lines(&self) -> usize
fn screen_lines(&self) -> usize
Height of the viewport in lines.
source§fn total_lines(&self) -> usize
fn total_lines(&self) -> usize
Total number of lines in the buffer, this includes scrollback and visible lines.
source§fn last_column(&self) -> Column
fn last_column(&self) -> Column
Index for the last column.
source§fn topmost_line(&self) -> Line
fn topmost_line(&self) -> Line
Line farthest up in the grid history.
source§fn bottommost_line(&self) -> Line
fn bottommost_line(&self) -> Line
Line farthest down in the grid history.
source§fn history_size(&self) -> usize
fn history_size(&self) -> usize
Number of invisible lines part of the scrollback history.
source§impl<T: PartialEq> PartialEq<SizeInfo<T>> for SizeInfo<T>
impl<T: PartialEq> PartialEq<SizeInfo<T>> for SizeInfo<T>
impl<T: Copy> Copy for SizeInfo<T>
impl<T: Eq> Eq for SizeInfo<T>
impl<T> StructuralEq for SizeInfo<T>
impl<T> StructuralPartialEq for SizeInfo<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for SizeInfo<T>where T: RefUnwindSafe,
impl<T> Send for SizeInfo<T>where T: Send,
impl<T> Sync for SizeInfo<T>where T: Sync,
impl<T> Unpin for SizeInfo<T>where T: Unpin,
impl<T> UnwindSafe for SizeInfo<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> ResetDiscriminant<T> for Twhere
T: Copy,
impl<T> ResetDiscriminant<T> for Twhere T: Copy,
source§fn discriminant(&self) -> T
fn discriminant(&self) -> T
Value based on which equality for the reset will be determined.