pub struct MockDisplay<C>(/* private fields */)
where
C: PixelColor;
Expand description
Mock display struct
See the module documentation for usage and examples.
Implementations§
Source§impl<C> MockDisplay<C>where
C: PixelColor,
impl<C> MockDisplay<C>where
C: PixelColor,
Source§impl<C> MockDisplay<C>where
C: PixelColor + ColorMapping<C>,
impl<C> MockDisplay<C>where
C: PixelColor + ColorMapping<C>,
Sourcepub fn from_pattern(pattern: &[&str]) -> MockDisplay<C>
pub fn from_pattern(pattern: &[&str]) -> MockDisplay<C>
Creates a new mock display from a character pattern.
The color pattern is specified by a slice of string slices. Each string slice represents a row of pixels and every character a single pixel.
A space character in the pattern represents a pixel which wasn’t
modified by any drawing routine and is left in the default state.
All other characters are converted by implementations of the
ColorMapping
trait.
Trait Implementations§
Source§impl<C> Clone for MockDisplay<C>where
C: PixelColor + Clone,
impl<C> Clone for MockDisplay<C>where
C: PixelColor + Clone,
Source§fn clone(&self) -> MockDisplay<C>
fn clone(&self) -> MockDisplay<C>
Returns a copy 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<C> Debug for MockDisplay<C>where
C: PixelColor + ColorMapping<C>,
impl<C> Debug for MockDisplay<C>where
C: PixelColor + ColorMapping<C>,
Source§impl<C> Default for MockDisplay<C>where
C: PixelColor,
impl<C> Default for MockDisplay<C>where
C: PixelColor,
Source§impl<C> DrawTarget<C> for MockDisplay<C>where
C: PixelColor,
impl<C> DrawTarget<C> for MockDisplay<C>where
C: PixelColor,
Source§type Error = Infallible
type Error = Infallible
Error type to return when a drawing operation fails. Read more
Source§fn draw_pixel(&mut self, pixel: Pixel<C>) -> Result<(), Self::Error>
fn draw_pixel(&mut self, pixel: Pixel<C>) -> Result<(), Self::Error>
Draws a pixel on the display.
Source§fn draw_iter<T>(&mut self, item: T) -> Result<(), Self::Error>where
T: IntoIterator<Item = Pixel<C>>,
fn draw_iter<T>(&mut self, item: T) -> Result<(), Self::Error>where
T: IntoIterator<Item = Pixel<C>>,
Draws an object from an iterator over its pixels.
Source§fn clear(&mut self, color: C) -> Result<(), Self::Error>where
Self: Sized,
fn clear(&mut self, color: C) -> Result<(), Self::Error>where
Self: Sized,
Clears the display with the supplied color. Read more
Source§fn draw_line(
&mut self,
item: &Styled<Line, PrimitiveStyle<C>>,
) -> Result<(), Self::Error>
fn draw_line( &mut self, item: &Styled<Line, PrimitiveStyle<C>>, ) -> Result<(), Self::Error>
Draws a styled line primitive. Read more
Source§fn draw_triangle(
&mut self,
item: &Styled<Triangle, PrimitiveStyle<C>>,
) -> Result<(), Self::Error>
fn draw_triangle( &mut self, item: &Styled<Triangle, PrimitiveStyle<C>>, ) -> Result<(), Self::Error>
Draws a styled triangle primitive. Read more
Source§fn draw_rectangle(
&mut self,
item: &Styled<Rectangle, PrimitiveStyle<C>>,
) -> Result<(), Self::Error>
fn draw_rectangle( &mut self, item: &Styled<Rectangle, PrimitiveStyle<C>>, ) -> Result<(), Self::Error>
Draws a styled rectangle primitive. Read more
Source§fn draw_circle(
&mut self,
item: &Styled<Circle, PrimitiveStyle<C>>,
) -> Result<(), Self::Error>
fn draw_circle( &mut self, item: &Styled<Circle, PrimitiveStyle<C>>, ) -> Result<(), Self::Error>
Draws a styled circle primitive. Read more
Source§impl<C> PartialEq for MockDisplay<C>where
C: PixelColor,
impl<C> PartialEq for MockDisplay<C>where
C: PixelColor,
impl<C> Copy for MockDisplay<C>where
C: PixelColor + Copy,
Auto Trait Implementations§
impl<C> Freeze for MockDisplay<C>where
C: Freeze,
impl<C> RefUnwindSafe for MockDisplay<C>where
C: RefUnwindSafe,
impl<C> Send for MockDisplay<C>where
C: Send,
impl<C> Sync for MockDisplay<C>where
C: Sync,
impl<C> Unpin for MockDisplay<C>where
C: Unpin,
impl<C> UnwindSafe for MockDisplay<C>where
C: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.