#[non_exhaustive]pub struct DrawCell<'a> {
pub layer: u8,
pub pos: Pos<u16>,
pub tile: &'a Tile,
pub grapheme: Option<&'a str>,
pub tint: Tint,
}Expand description
One cell handed to a backend at draw time: the tile, plus the state that does not fit in one.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.layer: u8Which layer this cell belongs to. Always 0 for cells arriving through
Output::draw.
pos: Pos<u16>Where the cell sits in the grid.
tile: &'a TileThe tile itself.
grapheme: Option<&'a str>The tile’s full grapheme cluster, or None to render Tile::glyph alone.
Some only for multi-codepoint clusters (combining marks, ZWJ sequences), and only
ever Some when the egc feature is enabled: without it Grid never populates the
side table, so a backend that does not support egc can ignore this entirely and render
from Tile::glyph.
tint: TintHow a pixel backend recolours this cell’s sprite.
Tint::None for the overwhelming majority of cells. Cell backends have no sprite to
recolour and ignore it; see Tint.
Implementations§
Source§impl<'a> DrawCell<'a>
impl<'a> DrawCell<'a>
Sourcepub const fn new(pos: Pos<u16>, tile: &'a Tile) -> DrawCell<'a>
pub const fn new(pos: Pos<u16>, tile: &'a Tile) -> DrawCell<'a>
A cell on layer 0 with no grapheme text and no tint: the shape almost every test and cell backend wants.
Sourcepub const fn on_layer(layer: u8, pos: Pos<u16>, tile: &'a Tile) -> DrawCell<'a>
pub const fn on_layer(layer: u8, pos: Pos<u16>, tile: &'a Tile) -> DrawCell<'a>
new on an explicit layer.
Sourcepub const fn with_grapheme(self, grapheme: Option<&'a str>) -> DrawCell<'a>
pub const fn with_grapheme(self, grapheme: Option<&'a str>) -> DrawCell<'a>
This cell with grapheme as its full cluster text.
Trait Implementations§
impl<'a> Copy for DrawCell<'a>
impl<'a> Eq for DrawCell<'a>
Source§impl<'a> PartialEq for DrawCell<'a>
impl<'a> PartialEq for DrawCell<'a>
impl<'a> StructuralPartialEq for DrawCell<'a>
Auto Trait Implementations§
impl<'a> Freeze for DrawCell<'a>
impl<'a> RefUnwindSafe for DrawCell<'a>
impl<'a> Send for DrawCell<'a>
impl<'a> Sync for DrawCell<'a>
impl<'a> Unpin for DrawCell<'a>
impl<'a> UnsafeUnpin for DrawCell<'a>
impl<'a> UnwindSafe for DrawCell<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> WasmNotSend for Twhere
T: Send,
impl<T> WasmNotSendSync for Twhere
T: WasmNotSend + WasmNotSync,
impl<T> WasmNotSync for Twhere
T: Sync,
§impl<C> WithAlpha for Cwhere
C: Copy,
impl<C> WithAlpha for Cwhere
C: Copy,
§fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
self with alpha, storing alpha before the color in memory
(see [AlphaFirst]).§fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
self with alpha, storing alpha after the color in memory
(see [AlphaLast]).