Skip to main content

PixelBackend

Struct PixelBackend 

Source
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>

Source

pub fn new(rasterizer: R, placement: Placement, quota: usize) -> Self

Source

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.

Source

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.

Source

pub fn with_bleed(self, bleed: Bleed) -> Self

Only direct placement can leave the text area: placeholders are cells.

Source

pub fn with_smooth(self, smooth: Smooth) -> Self

Source

pub fn tile_count(&self) -> usize

Source

pub fn used_bytes(&self) -> usize

Trait Implementations§

Source§

impl<R: Rasterizer> Backend for PixelBackend<R>

Source§

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<()>

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>

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<()>

Moves a scroll under way one step on.
Source§

fn settle(&mut self)

Ends a scroll under way, for the next present to show the page as it is.
Source§

fn invalidate(&mut self)

Forgets what the terminal shows, so the next present redraws everything.
Source§

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>

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.
Source§

fn take_work(&mut self) -> Work

What it has done since it was last asked: tiles sent and rows rasterized.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.