Struct embedded_graphics::mock_display::MockDisplay
source · [−]pub struct MockDisplay<C>(_)
where
C: PixelColor;
Expand description
Mock display struct
See the module documentation for usage and examples.
Implementations
sourceimpl<C> MockDisplay<C> where
C: PixelColor,
impl<C> MockDisplay<C> where
C: PixelColor,
sourceimpl<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
sourceimpl<C: Clone> Clone for MockDisplay<C> where
C: PixelColor,
impl<C: Clone> Clone for MockDisplay<C> where
C: PixelColor,
sourcefn clone(&self) -> MockDisplay<C>
fn clone(&self) -> MockDisplay<C>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<C> Debug for MockDisplay<C> where
C: PixelColor + ColorMapping<C>,
impl<C> Debug for MockDisplay<C> where
C: PixelColor + ColorMapping<C>,
sourceimpl<C> Default for MockDisplay<C> where
C: PixelColor,
impl<C> Default for MockDisplay<C> where
C: PixelColor,
sourceimpl<C> DrawTarget<C> for MockDisplay<C> where
C: PixelColor,
impl<C> DrawTarget<C> for MockDisplay<C> where
C: PixelColor,
type Error = Infallible
type Error = Infallible
Error type to return when a drawing operation fails. Read more
sourcefn 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.
sourcefn 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.
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn draw_image<'a, 'b, I>(
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
&'b I: IntoPixelIter<C>,
I: ImageDimensions,
C: PixelColor + From<<C as PixelColor>::Raw>,
fn draw_image<'a, 'b, I>(
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
&'b I: IntoPixelIter<C>,
I: ImageDimensions,
C: PixelColor + From<<C as PixelColor>::Raw>,
Draws an image with known size Read more
sourceimpl<C> PartialEq<MockDisplay<C>> for MockDisplay<C> where
C: PixelColor,
impl<C> PartialEq<MockDisplay<C>> for MockDisplay<C> where
C: PixelColor,
impl<C: Copy> Copy for MockDisplay<C> where
C: PixelColor,
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more