Skip to main content

Dots

Struct Dots 

Source
pub struct Dots<'a> { /* private fields */ }
Expand description

The canvas as braille dots, 2x4 per cell; see Canvas::dots. A cell’s dots share one colour: the last one drawn there.

Implementations§

Source§

impl Dots<'_>

Source

pub fn unset(&mut self, x: i64, y: i64)

Turns dot (x, y) off.

Source

pub fn is_set(&self, x: i64, y: i64) -> bool

Whether dot (x, y) is on.

Source

pub fn clear(&mut self)

Turns every dot off, keeping cell backgrounds.

Trait Implementations§

Source§

impl Shapes for Dots<'_>

Source§

fn size(&self) -> (i64, i64)

Size in points.
Source§

fn put(&mut self, x: i64, y: i64, colour: Rgb)

Sets one point; outside the surface it does nothing.
Source§

fn line(&mut self, x0: i64, y0: i64, x1: i64, y1: i64, colour: Rgb)

Source§

fn rect(&mut self, x: i64, y: i64, w: i64, h: i64, colour: Rgb)

Source§

fn fill_rect(&mut self, x: i64, y: i64, w: i64, h: i64, colour: Rgb)

Source§

fn circle(&mut self, cx: i64, cy: i64, r: i64, colour: Rgb)

Source§

fn fill_circle(&mut self, cx: i64, cy: i64, r: i64, colour: Rgb)

Source§

fn plot(&mut self, f: impl Fn(f64) -> f64, colour: Rgb)
where Self: Sized,

f from 0 to 1 across the width, with -1 at the bottom and 1 at the top, joined so steep parts have no gaps.

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for Dots<'a>

§

impl<'a> Forget for Dots<'a>

§

impl<'a> Freeze for Dots<'a>

§

impl<'a> Move for Dots<'a>

§

impl<'a> RefUnwindSafe for Dots<'a>

§

impl<'a> Send for Dots<'a>

§

impl<'a> Sync for Dots<'a>

§

impl<'a> Unpin for Dots<'a>

§

impl<'a> UnsafeUnpin for Dots<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.