Trait Renderer

pub trait Renderer: Renderer {
    type Font: Copy + PartialEq;
    type Paragraph: Paragraph<Font = Self::Font> + 'static;
    type Editor: Editor<Font = Self::Font> + 'static;
    type Raw;

    const ICON_FONT: Self::Font;
    const CHECKMARK_ICON: char;
    const ARROW_DOWN_ICON: char;
    const SCROLL_UP_ICON: char;
    const SCROLL_DOWN_ICON: char;
    const SCROLL_LEFT_ICON: char;
    const SCROLL_RIGHT_ICON: char;
    const ICED_LOGO: char;

    // Required methods
    fn default_font(&self) -> Self::Font;
    fn default_size(&self) -> Pixels;
    fn fill_paragraph(
        &mut self,
        text: &Self::Paragraph,
        position: Point,
        color: Color,
        clip_bounds: Rectangle,
    );
    fn fill_editor(
        &mut self,
        editor: &Self::Editor,
        position: Point,
        color: Color,
        clip_bounds: Rectangle,
    );
    fn fill_raw(&mut self, raw: Self::Raw);
    fn fill_text(
        &mut self,
        text: Text<String, Self::Font>,
        position: Point,
        color: Color,
        clip_bounds: Rectangle,
    );
}
Expand description

A renderer capable of measuring and drawing Text.

Required Associated Constants§

const ICON_FONT: Self::Font

The icon font of the backend.

const CHECKMARK_ICON: char

The char representing a ✔ icon in the ICON_FONT.

const ARROW_DOWN_ICON: char

The char representing a ▼ icon in the built-in ICON_FONT.

const SCROLL_UP_ICON: char

The char representing a ^ icon in the built-in ICON_FONT.

const SCROLL_DOWN_ICON: char

The char representing a v icon in the built-in ICON_FONT.

const SCROLL_LEFT_ICON: char

The char representing a < icon in the built-in ICON_FONT.

const SCROLL_RIGHT_ICON: char

The char representing a > icon in the built-in ICON_FONT.

The ‘char’ representing the iced logo in the built-in ‘ICON_FONT’.

Required Associated Types§

type Font: Copy + PartialEq

The font type used.

type Paragraph: Paragraph<Font = Self::Font> + 'static

The Paragraph of this Renderer.

type Editor: Editor<Font = Self::Font> + 'static

The Editor of this Renderer.

type Raw

The Raw of this Renderer.

Required Methods§

fn default_font(&self) -> Self::Font

Returns the default Self::Font.

fn default_size(&self) -> Pixels

Returns the default size of Text.

fn fill_paragraph( &mut self, text: &Self::Paragraph, position: Point, color: Color, clip_bounds: Rectangle, )

Draws the given Paragraph at the given position and with the given Color.

fn fill_editor( &mut self, editor: &Self::Editor, position: Point, color: Color, clip_bounds: Rectangle, )

Draws the given Editor at the given position and with the given Color.

fn fill_raw(&mut self, raw: Self::Raw)

Draws the given Raw

fn fill_text( &mut self, text: Text<String, Self::Font>, position: Point, color: Color, clip_bounds: Rectangle, )

Draws the given Text at the given position and with the given Color.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl Renderer for ()

§

const ICON_FONT: Font = Font::DEFAULT

§

const CHECKMARK_ICON: char = '0'

§

const ARROW_DOWN_ICON: char = '0'

§

const SCROLL_UP_ICON: char = '0'

§

const SCROLL_DOWN_ICON: char = '0'

§

const SCROLL_LEFT_ICON: char = '0'

§

const SCROLL_RIGHT_ICON: char = '0'

§

const ICED_LOGO: char = '0'

§

type Font = Font

§

type Paragraph = ()

§

type Editor = ()

§

type Raw = ()

§

fn default_font(&self) -> <() as Renderer>::Font

§

fn default_size(&self) -> Pixels

§

fn fill_paragraph( &mut self, _paragraph: &<() as Renderer>::Paragraph, _position: Point, _color: Color, _clip_bounds: Rectangle, )

§

fn fill_editor( &mut self, _editor: &<() as Renderer>::Editor, _position: Point, _color: Color, _clip_bounds: Rectangle, )

§

fn fill_raw(&mut self, _raw: <() as Renderer>::Raw)

§

fn fill_text( &mut self, _paragraph: Text, _position: Point, _color: Color, _clip_bounds: Rectangle, )

§

impl Renderer for Renderer

§

const ICON_FONT: Font

§

const CHECKMARK_ICON: char = '\u{f00c}'

§

const ARROW_DOWN_ICON: char = '\u{e800}'

§

const ICED_LOGO: char = '\u{e801}'

§

const SCROLL_UP_ICON: char = '\u{e802}'

§

const SCROLL_DOWN_ICON: char = '\u{e803}'

§

const SCROLL_LEFT_ICON: char = '\u{e804}'

§

const SCROLL_RIGHT_ICON: char = '\u{e805}'

§

type Font = Font

§

type Paragraph = Paragraph

§

type Editor = Editor

§

type Raw = Raw

§

fn default_font(&self) -> <Renderer as Renderer>::Font

§

fn default_size(&self) -> Pixels

§

fn fill_paragraph( &mut self, text: &<Renderer as Renderer>::Paragraph, position: Point, color: Color, clip_bounds: Rectangle, )

§

fn fill_editor( &mut self, editor: &<Renderer as Renderer>::Editor, position: Point, color: Color, clip_bounds: Rectangle, )

§

fn fill_text( &mut self, text: Text, position: Point, color: Color, clip_bounds: Rectangle, )

§

fn fill_raw(&mut self, raw: <Renderer as Renderer>::Raw)

§

impl<A, B> Renderer for Renderer<A, B>
where A: Renderer, B: Renderer<Font = <A as Renderer>::Font, Paragraph = <A as Renderer>::Paragraph, Editor = <A as Renderer>::Editor, Raw = <A as Renderer>::Raw>,

§

const ICON_FONT: <Renderer<A, B> as Renderer>::Font = A::ICON_FONT

§

const CHECKMARK_ICON: char = A::CHECKMARK_ICON

§

const ARROW_DOWN_ICON: char = A::ARROW_DOWN_ICON

§

const SCROLL_UP_ICON: char = A::SCROLL_UP_ICON

§

const SCROLL_DOWN_ICON: char = A::SCROLL_DOWN_ICON

§

const SCROLL_LEFT_ICON: char = A::SCROLL_LEFT_ICON

§

const SCROLL_RIGHT_ICON: char = A::SCROLL_RIGHT_ICON

§

const ICED_LOGO: char = A::ICED_LOGO

§

type Font = <A as Renderer>::Font

§

type Paragraph = <A as Renderer>::Paragraph

§

type Editor = <A as Renderer>::Editor

§

type Raw = <A as Renderer>::Raw

§

fn default_font(&self) -> <Renderer<A, B> as Renderer>::Font

§

fn default_size(&self) -> Pixels

§

fn fill_paragraph( &mut self, text: &<Renderer<A, B> as Renderer>::Paragraph, position: Point, color: Color, clip_bounds: Rectangle, )

§

fn fill_editor( &mut self, editor: &<Renderer<A, B> as Renderer>::Editor, position: Point, color: Color, clip_bounds: Rectangle, )

§

fn fill_raw(&mut self, raw: <Renderer<A, B> as Renderer>::Raw)

§

fn fill_text( &mut self, text: Text<String, <Renderer<A, B> as Renderer>::Font>, position: Point, color: Color, clip_bounds: Rectangle, )

Implementors§