Skip to main content

ConfigureCursorWrapper

Trait ConfigureCursorWrapper 

Source
pub trait ConfigureCursorWrapper<'a> {
    // Required methods
    fn get_cursor_blink(&self) -> Blink;
    fn set_cursor_blink(&mut self, blink: Blink);
    fn get_cursor_colors(&self) -> Colors;
    fn set_cursor_colors(&mut self, colors: Colors);
    fn get_cursor_extent(&self) -> Extent;
    fn set_cursor_extent(&mut self, extent: Extent);
    fn get_cursor_symbol(&self) -> Symbol<'a>;
    fn set_cursor_symbol(&mut self, symbol: Symbol<'a>);
}
Expand description

Backend configuration retrieval and modification of the CursorWrapper layer.

A backend wrapper that implements this trait allows the fields of a CursorWrapper that are configurable to have their values read or have new values assigned.

Required Methods§

Returns the blink animation cycle for the cursor.

§Examples
use dumo::blink::Blink;
use dumo::cursor::{Colors, Cursor, Extent};
use dumo::fonts::*;
use dumo::{ConfigureCursorWrapper, DumoBackend};

let backend = DumoBackend::new(&mut display, &FONT_8X24_4_BITS).with_cursor(
    Cursor::default()
        .blink(Blink::with_period(10))
        .colors(Colors::InvertedReset)
        .extent(Extent::Underline { height: 2 }),
);

let cursor_blink = backend.get_cursor_blink();

Sets the blink animation cycle for the cursor.

§Examples
use dumo::blink::Blink;
use dumo::cursor::{Colors, Cursor, Extent};
use dumo::fonts::*;
use dumo::{ConfigureCursorWrapper, DumoBackend};

let mut backend = DumoBackend::new(&mut display, &FONT_8X24_4_BITS).with_cursor(
    Cursor::default()
        .blink(Blink::with_period(10))
        .colors(Colors::InvertedReset)
        .extent(Extent::Underline { height: 2 }),
);

backend.set_cursor_blink(Blink::with_period(12));
Source

fn get_cursor_colors(&self) -> Colors

Returns the method used by the cursor for choosing colors.

§Examples
use dumo::blink::Blink;
use dumo::cursor::{Colors, Cursor, Extent};
use dumo::fonts::*;
use dumo::{ConfigureCursorWrapper, DumoBackend};

let backend = DumoBackend::new(&mut display, &FONT_8X24_4_BITS).with_cursor(
    Cursor::default()
        .blink(Blink::with_period(10))
        .colors(Colors::InvertedReset)
        .extent(Extent::Underline { height: 2 }),
);

let cursor_colors = backend.get_cursor_colors();
Source

fn set_cursor_colors(&mut self, colors: Colors)

Sets the method used by the cursor for choosing colors.

§Examples
use dumo::blink::Blink;
use dumo::cursor::{Colors, Cursor, Extent};
use dumo::fonts::*;
use dumo::{ConfigureCursorWrapper, DumoBackend};

let mut backend = DumoBackend::new(&mut display, &FONT_8X24_4_BITS).with_cursor(
    Cursor::default()
        .blink(Blink::with_period(10))
        .colors(Colors::InvertedReset)
        .extent(Extent::Underline { height: 2 }),
);

backend.set_cursor_colors(Colors::ReversedReset);
Source

fn get_cursor_extent(&self) -> Extent

Returns the shape that represents the cursor inside of the cell area.

§Examples
use dumo::blink::Blink;
use dumo::cursor::{Colors, Cursor, Extent};
use dumo::fonts::*;
use dumo::{ConfigureCursorWrapper, DumoBackend};

let backend = DumoBackend::new(&mut display, &FONT_8X24_4_BITS).with_cursor(
    Cursor::default()
        .blink(Blink::with_period(10))
        .colors(Colors::InvertedReset)
        .extent(Extent::Underline { height: 2 }),
);

let cursor_extent = backend.get_cursor_extent();
Source

fn set_cursor_extent(&mut self, extent: Extent)

Sets the shape that represents the cursor inside of the cell area.

§Examples
use dumo::blink::Blink;
use dumo::cursor::{Colors, Cursor, Extent};
use dumo::fonts::*;
use dumo::{ConfigureCursorWrapper, DumoBackend};

let mut backend = DumoBackend::new(&mut display, &FONT_8X24_4_BITS).with_cursor(
    Cursor::default()
        .blink(Blink::with_period(10))
        .colors(Colors::InvertedReset)
        .extent(Extent::Underline { height: 2 }),
);

backend.set_cursor_extent(Extent::VerticalBar { width: 2 });
Source

fn get_cursor_symbol(&self) -> Symbol<'a>

Returns the source of the content that the cursor uses to symbolize itself.

§Examples
use dumo::blink::Blink;
use dumo::cursor::{Colors, Cursor, Symbol};
use dumo::fonts::*;
use dumo::{ConfigureCursorWrapper, DumoBackend};

let backend = DumoBackend::new(&mut display, &FONT_8X24_4_BITS).with_cursor(
    Cursor::default()
        .blink(Blink::with_period(10))
        .colors(Colors::InvertedReset)
        .symbol(Symbol::Custom("🮕🮕")),
);

let cursor_symbol = backend.get_cursor_symbol();
Source

fn set_cursor_symbol(&mut self, symbol: Symbol<'a>)

Sets the source of the content that the cursor uses to symbolize itself.

§Examples
use dumo::blink::Blink;
use dumo::cursor::{Colors, Cursor, Symbol};
use dumo::fonts::*;
use dumo::{ConfigureCursorWrapper, DumoBackend};

let mut backend = DumoBackend::new(&mut display, &FONT_8X24_4_BITS).with_cursor(
    Cursor::default()
        .blink(Blink::with_period(10))
        .colors(Colors::InvertedReset)
        .symbol(Symbol::Custom("🮕🮕")),
);

backend.set_cursor_symbol(Symbol::UnderCursor);

Implementors§

Source§

impl<'a, B, D> ConfigureCursorWrapper<'a> for CursorWrapper<'a, B, D>
where B: DrawTargetBackend<D, Error = Error<D::Error>>, D: DrawTarget, D::Error: Debug,

Source§

impl<'a, W, B> ConfigureCursorWrapper<'a> for W
where B: ConfigureCursorWrapper<'a>, W: WrapTrait<ConfigureCursorWrapper, Inner = B>,

Blanket implementation of the ConfigureCursorWrapper trait for function call passthrough.