Trait Backend

pub trait Backend: Sized {
    type Geometry;

Show 20 methods // Required methods fn width(&self) -> f32; fn height(&self) -> f32; fn size(&self) -> Size; fn center(&self) -> Point; fn push_transform(&mut self); fn pop_transform(&mut self); fn translate(&mut self, translation: Vector); fn rotate(&mut self, angle: impl Into<Radians>); fn scale(&mut self, scale: impl Into<f32>); fn scale_nonuniform(&mut self, scale: impl Into<Vector>); fn draft(&mut self, clip_bounds: Rectangle) -> Self; fn paste(&mut self, frame: Self); fn stroke<'a>(&mut self, path: &Path, stroke: impl Into<Stroke<'a>>); fn stroke_rectangle<'a>( &mut self, top_left: Point, size: Size, stroke: impl Into<Stroke<'a>>, ); fn fill(&mut self, path: &Path, fill: impl Into<Fill>); fn fill_text(&mut self, text: impl Into<Text>); fn fill_rectangle( &mut self, top_left: Point, size: Size, fill: impl Into<Fill>, ); fn draw_image(&mut self, bounds: Rectangle, image: impl Into<Image>); fn draw_svg(&mut self, bounds: Rectangle, svg: impl Into<Svg>); fn into_geometry(self) -> Self::Geometry;
}
Available on crate feature geometry only.
Expand description

The internal implementation of a Frame.

Analogous to Frame. See Frame for the documentation of each method.

Required Associated Types§

Required Methods§

fn width(&self) -> f32

fn height(&self) -> f32

fn size(&self) -> Size

fn center(&self) -> Point

fn push_transform(&mut self)

fn pop_transform(&mut self)

fn translate(&mut self, translation: Vector)

fn rotate(&mut self, angle: impl Into<Radians>)

fn scale(&mut self, scale: impl Into<f32>)

fn scale_nonuniform(&mut self, scale: impl Into<Vector>)

fn draft(&mut self, clip_bounds: Rectangle) -> Self

fn paste(&mut self, frame: Self)

fn stroke<'a>(&mut self, path: &Path, stroke: impl Into<Stroke<'a>>)

fn stroke_rectangle<'a>( &mut self, top_left: Point, size: Size, stroke: impl Into<Stroke<'a>>, )

fn fill(&mut self, path: &Path, fill: impl Into<Fill>)

fn fill_text(&mut self, text: impl Into<Text>)

fn fill_rectangle(&mut self, top_left: Point, size: Size, fill: impl Into<Fill>)

fn draw_image(&mut self, bounds: Rectangle, image: impl Into<Image>)

fn draw_svg(&mut self, bounds: Rectangle, svg: impl Into<Svg>)

fn into_geometry(self) -> Self::Geometry

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 Backend for ()

Available on debug-assertions enabled only.
§

type Geometry = ()

§

fn width(&self) -> f32

§

fn height(&self) -> f32

§

fn size(&self) -> Size

§

fn center(&self) -> Point

§

fn push_transform(&mut self)

§

fn pop_transform(&mut self)

§

fn translate(&mut self, _translation: Vector)

§

fn rotate(&mut self, _angle: impl Into<Radians>)

§

fn scale(&mut self, _scale: impl Into<f32>)

§

fn scale_nonuniform(&mut self, _scale: impl Into<Vector>)

§

fn draft(&mut self, _clip_bounds: Rectangle)

§

fn paste(&mut self, _frame: ())

§

fn stroke<'a>(&mut self, _path: &Path, _stroke: impl Into<Stroke<'a>>)

§

fn stroke_rectangle<'a>( &mut self, _top_left: Point, _size: Size, _stroke: impl Into<Stroke<'a>>, )

§

fn fill(&mut self, _path: &Path, _fill: impl Into<Fill>)

§

fn fill_text(&mut self, _text: impl Into<Text>)

§

fn fill_rectangle( &mut self, _top_left: Point, _size: Size, _fill: impl Into<Fill>, )

§

fn draw_image(&mut self, _bounds: Rectangle, _image: impl Into<Image>)

§

fn draw_svg(&mut self, _bounds: Rectangle, _svg: impl Into<Svg>)

§

fn into_geometry(self) -> <() as Backend>::Geometry

§

impl Backend for Frame

§

type Geometry = Geometry

§

fn width(&self) -> f32

§

fn height(&self) -> f32

§

fn size(&self) -> Size

§

fn center(&self) -> Point

§

fn fill(&mut self, path: &Path, fill: impl Into<Fill>)

§

fn fill_rectangle(&mut self, top_left: Point, size: Size, fill: impl Into<Fill>)

§

fn stroke<'a>(&mut self, path: &Path, stroke: impl Into<Stroke<'a>>)

§

fn stroke_rectangle<'a>( &mut self, top_left: Point, size: Size, stroke: impl Into<Stroke<'a>>, )

§

fn fill_text(&mut self, text: impl Into<Text>)

§

fn translate(&mut self, translation: Vector)

§

fn rotate(&mut self, angle: impl Into<Radians>)

§

fn scale(&mut self, scale: impl Into<f32>)

§

fn scale_nonuniform(&mut self, scale: impl Into<Vector>)

§

fn push_transform(&mut self)

§

fn pop_transform(&mut self)

§

fn draft(&mut self, clip_bounds: Rectangle) -> Frame

§

fn paste(&mut self, frame: Frame)

§

fn into_geometry(self) -> <Frame as Backend>::Geometry

§

fn draw_image(&mut self, bounds: Rectangle, image: impl Into<Image>)

§

fn draw_svg(&mut self, bounds: Rectangle, svg: impl Into<Svg>)

§

impl Backend for Frame

§

type Geometry = Geometry

§

fn width(&self) -> f32

§

fn height(&self) -> f32

§

fn size(&self) -> Size

§

fn center(&self) -> Point

§

fn fill(&mut self, path: &Path, fill: impl Into<Fill>)

§

fn fill_rectangle(&mut self, top_left: Point, size: Size, fill: impl Into<Fill>)

§

fn stroke<'a>(&mut self, path: &Path, stroke: impl Into<Stroke<'a>>)

§

fn stroke_rectangle<'a>( &mut self, top_left: Point, size: Size, stroke: impl Into<Stroke<'a>>, )

§

fn fill_text(&mut self, text: impl Into<Text>)

§

fn push_transform(&mut self)

§

fn pop_transform(&mut self)

§

fn draft(&mut self, clip_bounds: Rectangle) -> Frame

§

fn paste(&mut self, frame: Frame)

§

fn translate(&mut self, translation: Vector)

§

fn rotate(&mut self, angle: impl Into<Radians>)

§

fn scale(&mut self, scale: impl Into<f32>)

§

fn scale_nonuniform(&mut self, scale: impl Into<Vector>)

§

fn into_geometry(self) -> Geometry

§

fn draw_image(&mut self, bounds: Rectangle, image: impl Into<Image>)

§

fn draw_svg(&mut self, bounds: Rectangle, svg: impl Into<Svg>)

Implementors§