Skip to main content

FootprintSink

Struct FootprintSink 

Source
pub struct FootprintSink<'a> { /* private fields */ }
Expand description

A StampSink that measures the stamps passing through it and hands each one on.

The footprint counts every stamp, not every cell. A position the buffer behind it discards — outside its window — still moves the footprint, and so does a stamp the composition finds already decided: what is measured is how far the drawing reached, which is a fact of the traffic rather than of the picture that survived it. Accumulating before delegating is what makes those two the same question, and it is the whole of the rule this adapter carries.

Implementations§

Source§

impl<'a> FootprintSink<'a>

Source

pub fn new(sink: &'a mut dyn StampSink) -> Self

Wraps sink, so that every stamp written through this one is measured and then drawn.

Source

pub fn footprint(&self) -> Option<Footprint>

The rectangle the stamps written through this sink reach, or None while none has been.

The answer is a value rather than a borrow, so a caller holds what it is given and may go on stamping and ask again.

Trait Implementations§

Source§

impl StampSink for FootprintSink<'_>

Source§

fn stamp( &mut self, at: Pos, cell: Cell, mode: StampMode, owner: Option<ShapeId>, )

Writes cell at the absolute position at, under mode, recorded under owner. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for FootprintSink<'a>

§

impl<'a> !Send for FootprintSink<'a>

§

impl<'a> !Sync for FootprintSink<'a>

§

impl<'a> !UnwindSafe for FootprintSink<'a>

§

impl<'a> Forget for FootprintSink<'a>

§

impl<'a> Freeze for FootprintSink<'a>

§

impl<'a> Unpin for FootprintSink<'a>

§

impl<'a> UnsafeUnpin for FootprintSink<'a>

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.