pub struct StaticCharacterDisplay<CharacterPixel, const WIDTH: usize, const HEIGHT: usize> { /* private fields */ }Implementations§
Source§impl<const WIDTH: usize, const HEIGHT: usize> StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<const WIDTH: usize, const HEIGHT: usize> StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
Sourcepub fn new(fill: CharacterPixel) -> Self
pub fn new(fill: CharacterPixel) -> Self
Convenience method to build a blank display struct with specified dimensions
§Panics
This function panics if the data generated from the fill does not match the dimensions of the display. This should not happen and is subject to change in the future.
Sourcepub fn build_from_data(data: &[CharacterPixel]) -> Result<Self, String>
pub fn build_from_data(data: &[CharacterPixel]) -> Result<Self, String>
Builds a display struct with the specified dimensions from the given data.
§Errors
Returns an error when the data length does not match the dimensions of the display. This also applies if double-width characters, like あ, are used and exceed the dimensions of the display.
Trait Implementations§
Source§impl<CharacterPixel: Clone, const WIDTH: usize, const HEIGHT: usize> Clone for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<CharacterPixel: Clone, const WIDTH: usize, const HEIGHT: usize> Clone for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
Source§fn clone(&self) -> StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
fn clone(&self) -> StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const WIDTH: usize, const HEIGHT: usize> DynamicCanvas<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<const WIDTH: usize, const HEIGHT: usize> DynamicCanvas<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
type A = usize
Source§fn pixel(&self, x: Self::A, y: Self::A) -> Result<CharacterPixelData, String>
fn pixel(&self, x: Self::A, y: Self::A) -> Result<CharacterPixelData, String>
Returns a bool representing the state of the pixel at the specified coordinate. Read more
Source§impl<const WIDTH: usize, const HEIGHT: usize> DynamicConsoleDisplay<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<const WIDTH: usize, const HEIGHT: usize> DynamicConsoleDisplay<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
Source§fn width(&self) -> usize
fn width(&self) -> usize
Returns the width of the display in a display specific, individually addressable unit (e.g. pixels, characters).
Source§fn height(&self) -> usize
fn height(&self) -> usize
Returns the height of the display in a display specific, individually addressable unit (e.g. pixels, characters).
fn data(&self) -> &[CharacterPixel]
fn data_mut(&mut self) -> &mut Box<[CharacterPixel]>
Source§impl<const WIDTH: usize, const HEIGHT: usize> DynamicWidget for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<const WIDTH: usize, const HEIGHT: usize> DynamicWidget for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
Source§fn width_characters(&self) -> usize
fn width_characters(&self) -> usize
Returns the width of the display in characters.
Source§fn height_characters(&self) -> usize
fn height_characters(&self) -> usize
Returns the height of the display in characters.
Source§fn string_data(&self) -> StringData
fn string_data(&self) -> StringData
Returns a string representation.
The first vector contains rows.
The vectors inside/rows contain individual characters.
Source§impl<const WIDTH: usize, const HEIGHT: usize> StaticConsoleDisplay<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<const WIDTH: usize, const HEIGHT: usize> StaticConsoleDisplay<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
Source§impl<const WIDTH: usize, const HEIGHT: usize> StaticWidget for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<const WIDTH: usize, const HEIGHT: usize> StaticWidget for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
Source§const WIDTH_CHARACTERS: usize = WIDTH
const WIDTH_CHARACTERS: usize = WIDTH
Width of the display in characters.
Source§const HEIGHT_CHARACTERS: usize = HEIGHT
const HEIGHT_CHARACTERS: usize = HEIGHT
Height of the display in characters.
Auto Trait Implementations§
impl<CharacterPixel, const WIDTH: usize, const HEIGHT: usize> Freeze for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<CharacterPixel, const WIDTH: usize, const HEIGHT: usize> RefUnwindSafe for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>where
CharacterPixel: RefUnwindSafe,
impl<CharacterPixel, const WIDTH: usize, const HEIGHT: usize> Send for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>where
CharacterPixel: Send,
impl<CharacterPixel, const WIDTH: usize, const HEIGHT: usize> Sync for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>where
CharacterPixel: Sync,
impl<CharacterPixel, const WIDTH: usize, const HEIGHT: usize> Unpin for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<CharacterPixel, const WIDTH: usize, const HEIGHT: usize> UnwindSafe for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>where
CharacterPixel: 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