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 From<SizeInfo> for WindowSize
impl From<SizeInfo> for WindowSize
source§impl<T: PartialEq> PartialEq for SizeInfo<T>
impl<T: PartialEq> PartialEq for SizeInfo<T>
impl<T: Copy> Copy for SizeInfo<T>
impl<T: Eq> Eq for SizeInfo<T>
impl<T> StructuralPartialEq for SizeInfo<T>
Auto Trait Implementations§
impl<T> Freeze for SizeInfo<T>where
T: Freeze,
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<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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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> 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.