Skip to main content

ShapeExt

Trait ShapeExt 

Source
pub trait ShapeExt {
    // Required methods
    fn fill(self, color: Color) -> Self;
    fn stroke(self, color: Color, width_pt: f64) -> Self;
    fn text(self, text: &str) -> Self;
}
Expand description

Extension trait for shapes to provide shorter method names

Required Methods§

Source

fn fill(self, color: Color) -> Self

Set the fill color (shorter alias for with_fill)

Source

fn stroke(self, color: Color, width_pt: f64) -> Self

Set the stroke/line (shorter alias for with_line)

Source

fn text(self, text: &str) -> Self

Set the text (shorter alias for with_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.

Implementors§