[−][src]Struct glint::term_buffer::TermBuffer
Represents a range of lines in a terminal and the cursor position. This is suitable when you don't want to use an "alternate screen", but rather retain previous terminal output, such as shell prompts/responses.
New frames are rendered by replacing the lines. All operations work on a relative coordinate system where (0, 0) is the top-left corner of the lines TermBuffer controls.
Further, we never check the actual cursor position, but rather move the cursor relative to its current position. The meaning of (0, 0) is actually the cursor position when TermBuffer first renders.
Methods
impl TermBuffer
[src]
pub fn new() -> Self
[src]
pub fn push_line(&mut self, row: impl Into<String>)
[src]
Add a row to the desired output
pub fn lines(&self) -> u16
[src]
pub fn set_next_cursor(&mut self, cursor: (u16, u16))
[src]
Positions the cursor where (0, 0) is the first character printed by this program
pub fn forget(&mut self)
[src]
This causes us to skip past the currently displayed buffer area and forget about it, resulting in future renders to happen below it. If this is called, and then the TermBuffer is dropped, the default behavior of clearing the area will be a no-op.
pub fn render_frame(&mut self)
[src]
Renders a complete frame to the terminal
pub fn flush(&mut self)
[src]
Trait Implementations
impl Default for TermBuffer
[src]
impl Drop for TermBuffer
[src]
Auto Trait Implementations
impl Unpin for TermBuffer
impl Sync for TermBuffer
impl Send for TermBuffer
impl UnwindSafe for TermBuffer
impl RefUnwindSafe for TermBuffer
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,