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_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.

Auto Trait Implementations§

§

impl<R> Freeze for PixelBackend<R>
where R: Freeze,

§

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.