pub struct PixelBackend<R> { /* private fields */ }Expand description
Renders each row once as a tile, keeps it in the terminal’s image store, and moves it by reference, so only new content crosses the wire.
Implementations§
Source§impl<R: Rasterizer> PixelBackend<R>
impl<R: Rasterizer> PixelBackend<R>
pub fn new(rasterizer: R, placement: Placement, quota: usize) -> Self
Sourcepub fn with_files(self, files: TileFiles) -> Self
pub fn with_files(self, files: TileFiles) -> Self
Hands tiles over as files the terminal reads, wherever files takes them. Direct
placement only: placeholders are for tmux, which has the terminal somewhere else.
Sourcepub fn with_own_rows(self, own: OwnRows) -> Self
pub fn with_own_rows(self, own: OwnRows) -> Self
Lays rows out at a height of Cellix’s own. Nothing glides: a glide counts in lines.
Sourcepub fn with_bleed(self, bleed: Bleed) -> Self
pub fn with_bleed(self, bleed: Bleed) -> Self
Only direct placement can leave the text area: placeholders are cells.
pub fn with_smooth(self, smooth: Smooth) -> Self
pub fn tile_count(&self) -> usize
pub fn used_bytes(&self) -> usize
Trait Implementations§
Source§impl<R: Rasterizer> Backend for PixelBackend<R>
impl<R: Rasterizer> Backend for PixelBackend<R>
fn present(&mut self, grid: &Grid, out: &mut dyn Write) -> Result<()>
Source§fn 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.Source§fn gliding(&self) -> Option<Duration>
fn gliding(&self) -> Option<Duration>
How often a scroll under way wants to move, if there is one.
Source§fn glide(&mut self, now: Instant, out: &mut dyn Write) -> Result<()>
fn glide(&mut self, now: Instant, out: &mut dyn Write) -> Result<()>
Moves a scroll under way one step on.
Source§fn invalidate(&mut self)
fn invalidate(&mut self)
Forgets what the terminal shows, so the next present redraws everything.
Source§fn set_lines(&mut self, lines: u16)
fn set_lines(&mut self, lines: u16)
How many lines the terminal has. Only a backend whose rows aren’t the terminal’s
lines needs telling: it fills what’s left under its last row.
Source§fn foot_drops(&self, rows: u16, foot: u16) -> Vec<usize>
fn foot_drops(&self, rows: u16, foot: u16) -> Vec<usize>
How far below its own place each of the last
foot rows of rows is drawn, in
pixels, the last of them last. Only a backend that stands its foot’s rows apart in
what’s under the sheets says anything: a press there is then on the row drawn where
it lands, which isn’t the row that begins there.Auto Trait Implementations§
impl<R> Forget for PixelBackend<R>
impl<R> Freeze for PixelBackend<R>where
R: Freeze,
impl<R> Move for PixelBackend<R>
impl<R> RefUnwindSafe for PixelBackend<R>where
R: RefUnwindSafe,
impl<R> Send for PixelBackend<R>where
R: Send,
impl<R> Sync for PixelBackend<R>where
R: Sync,
impl<R> Unpin for PixelBackend<R>where
R: Unpin,
impl<R> UnsafeUnpin for PixelBackend<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for PixelBackend<R>where
R: 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