nuit_core/compose/shape/
ext.rs

1use crate::Style;
2
3use super::{Fill, Shape, Stroke};
4
5/// An extension trait with various convenience methods for shapes.
6pub trait ShapeExt: Sized {
7    fn fill(self, style: impl Into<Style>) -> Fill<Self> {
8        Fill::new(self, style.into())
9    }
10
11    fn stroke(self, style: impl Into<Style>) -> Stroke<Self> {
12        Stroke::new(self, style.into())
13    }
14}
15
16impl<T> ShapeExt for T where T: Shape {}