pub trait Renderer {
// Required methods
fn begin(&mut self, capture: bool);
fn transform(&mut self, transform: Affine);
fn set_z_index(&mut self, z_index: i32);
fn clip(&mut self, shape: &impl Shape);
fn clear_clip(&mut self);
fn stroke<'b, 's>(
&mut self,
shape: &impl Shape,
brush: impl Into<BrushRef<'b>>,
stroke: &'s Stroke,
);
fn fill<'b>(
&mut self,
path: &impl Shape,
brush: impl Into<BrushRef<'b>>,
blur_radius: f64,
);
fn draw_text_with_layout<'b>(
&mut self,
layout: impl Iterator<Item = LayoutRun<'b>>,
pos: impl Into<Point>,
);
fn draw_svg<'b>(
&mut self,
svg: Svg<'b>,
rect: Rect,
brush: Option<impl Into<BrushRef<'b>>>,
);
fn draw_img(&mut self, img: Img<'_>, rect: Rect);
fn finish(&mut self) -> Option<Image>;
// Provided method
fn draw_text(&mut self, layout: &TextLayout, pos: impl Into<Point>) { ... }
}
Required Methods§
fn begin(&mut self, capture: bool)
fn transform(&mut self, transform: Affine)
fn set_z_index(&mut self, z_index: i32)
fn clear_clip(&mut self)
Sourcefn stroke<'b, 's>(
&mut self,
shape: &impl Shape,
brush: impl Into<BrushRef<'b>>,
stroke: &'s Stroke,
)
fn stroke<'b, 's>( &mut self, shape: &impl Shape, brush: impl Into<BrushRef<'b>>, stroke: &'s Stroke, )
Stroke a [Shape
].
Sourcefn fill<'b>(
&mut self,
path: &impl Shape,
brush: impl Into<BrushRef<'b>>,
blur_radius: f64,
)
fn fill<'b>( &mut self, path: &impl Shape, brush: impl Into<BrushRef<'b>>, blur_radius: f64, )
Fill a [Shape
], using the non-zero fill rule.
fn draw_text_with_layout<'b>( &mut self, layout: impl Iterator<Item = LayoutRun<'b>>, pos: impl Into<Point>, )
fn draw_svg<'b>( &mut self, svg: Svg<'b>, rect: Rect, brush: Option<impl Into<BrushRef<'b>>>, )
fn draw_img(&mut self, img: Img<'_>, rect: Rect)
fn finish(&mut self) -> Option<Image>
Provided Methods§
Sourcefn draw_text(&mut self, layout: &TextLayout, pos: impl Into<Point>)
fn draw_text(&mut self, layout: &TextLayout, pos: impl Into<Point>)
Draw a TextLayout
.
The pos
parameter specifies the upper-left corner of the layout object
(even for right-to-left text).
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.