pub trait Backend {
// Required methods
fn present(&mut self, grid: &Grid, out: &mut dyn Write) -> Result<()>;
fn invalidate(&mut self);
// Provided methods
fn scroll(
&mut self,
_from: &Grid,
_to: &Grid,
_area: Rect,
_rows: i32,
_out: &mut dyn Write,
) -> Result<()> { ... }
fn gliding(&self) -> Option<Duration> { ... }
fn glide(&mut self, _now: Instant, _out: &mut dyn Write) -> Result<()> { ... }
fn settle(&mut self) { ... }
}Expand description
Presents a grid. Implementations send only what changed since the last call.
Required Methods§
fn present(&mut self, grid: &Grid, out: &mut dyn Write) -> Result<()>
Sourcefn invalidate(&mut self)
fn invalidate(&mut self)
Forgets what the terminal shows, so the next present redraws everything.
Provided Methods§
Sourcefn scroll(
&mut self,
_from: &Grid,
_to: &Grid,
_area: Rect,
_rows: i32,
_out: &mut dyn Write,
) -> Result<()>
fn scroll( &mut self, _from: &Grid, _to: &Grid, _area: Rect, _rows: i32, _out: &mut dyn Write, ) -> Result<()>
Starts moving area from one grid to the other, rows lines further down the content,
or up if negative, and carries on from where it is if it’s already moving. The moving
happens in glide. Tiers that can’t move
anything by less than a cell do nothing, and the page just jumps.
Sourcefn gliding(&self) -> Option<Duration>
fn gliding(&self) -> Option<Duration>
How often a scroll under way wants to move, if there is one.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".