pub struct DynamicCharacterDisplay<CharacterPixel> { /* private fields */ }Implementations§
Source§impl DynamicCharacterDisplay<CharacterPixel>
impl DynamicCharacterDisplay<CharacterPixel>
Sourcepub fn new(width: usize, height: usize, fill: CharacterPixel) -> Self
pub fn new(width: usize, height: usize, 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(
width: usize,
height: usize,
data: &[CharacterPixel],
) -> Result<Self, String>
pub fn build_from_data( width: usize, height: usize, data: &[CharacterPixel], ) -> Result<Self, String>
Builds a display struct from the given data with the specified dimensions.
§Errors
Returns an error when the length of the data does not match the dimensions of the display.
Trait Implementations§
Source§impl<S: Pixel<U = CharacterPixelData>> DynamicCanvas<S> for DynamicCharacterDisplay<CharacterPixel>
impl<S: Pixel<U = CharacterPixelData>> DynamicCanvas<S> for DynamicCharacterDisplay<CharacterPixel>
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 DynamicConsoleDisplay<CharacterPixel> for DynamicCharacterDisplay<CharacterPixel>
impl DynamicConsoleDisplay<CharacterPixel> for DynamicCharacterDisplay<CharacterPixel>
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 DynamicWidget for DynamicCharacterDisplay<CharacterPixel>
impl DynamicWidget for DynamicCharacterDisplay<CharacterPixel>
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.
Auto Trait Implementations§
impl<CharacterPixel> Freeze for DynamicCharacterDisplay<CharacterPixel>
impl<CharacterPixel> RefUnwindSafe for DynamicCharacterDisplay<CharacterPixel>where
CharacterPixel: RefUnwindSafe,
impl<CharacterPixel> Send for DynamicCharacterDisplay<CharacterPixel>where
CharacterPixel: Send,
impl<CharacterPixel> Sync for DynamicCharacterDisplay<CharacterPixel>where
CharacterPixel: Sync,
impl<CharacterPixel> Unpin for DynamicCharacterDisplay<CharacterPixel>
impl<CharacterPixel> UnwindSafe for DynamicCharacterDisplay<CharacterPixel>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