pub struct ChangeSequence { /* private fields */ }
Expand description
Keeps track of a run of changes and allows reasoning about the cursor position and the extent of the screen that the sequence will affect. This is useful for example when implementing something like a LineEditor where you don’t want to take control over the entire surface but do want to be able to emit a dynamically sized output relative to the cursor position at the time that the editor is invoked.
Implementations
sourceimpl ChangeSequence
impl ChangeSequence
pub fn new(rows: usize, cols: usize) -> Self
pub fn consume(self) -> Vec<Change>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourcepub fn current_cursor_position(&self) -> (usize, isize)
pub fn current_cursor_position(&self) -> (usize, isize)
Returns the cursor position, (x, y).
pub fn move_to(&mut self, (cursor_x, cursor_y): (usize, isize))
sourcepub fn render_height(&self) -> usize
pub fn render_height(&self) -> usize
Returns the total number of rows affected
pub fn add_changes(&mut self, changes: Vec<Change>)
pub fn add<C: Into<Change>>(&mut self, change: C)
Auto Trait Implementations
impl RefUnwindSafe for ChangeSequence
impl Send for ChangeSequence
impl Sync for ChangeSequence
impl Unpin for ChangeSequence
impl UnwindSafe for ChangeSequence
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more