pub trait StrokeWidth {
// Required methods
fn stroke_width(&self) -> f32;
fn apply_stroke_func(
&mut self,
f: impl for<'a> Fn(&'a mut [Width]),
) -> &mut Self;
// Provided method
fn set_stroke_width(&mut self, width: f32) -> &mut Self { ... }
}Expand description
A trait for items have stroke width
Required Methods§
Sourcefn stroke_width(&self) -> f32
fn stroke_width(&self) -> f32
Get the stroke width
Sourcefn apply_stroke_func(
&mut self,
f: impl for<'a> Fn(&'a mut [Width]),
) -> &mut Self
fn apply_stroke_func( &mut self, f: impl for<'a> Fn(&'a mut [Width]), ) -> &mut Self
Applying stroke width function to an item
Provided Methods§
Sourcefn set_stroke_width(&mut self, width: f32) -> &mut Self
fn set_stroke_width(&mut self, width: f32) -> &mut Self
Setting stroke width of an item
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl StrokeWidth for SvgItem
impl StrokeWidth for SvgItem
fn stroke_width(&self) -> f32
fn apply_stroke_func( &mut self, f: impl for<'a> Fn(&'a mut [Width]), ) -> &mut SvgItem
fn set_stroke_width(&mut self, width: f32) -> &mut SvgItem
Source§impl StrokeWidth for TypstText
impl StrokeWidth for TypstText
fn stroke_width(&self) -> f32
fn apply_stroke_func( &mut self, f: impl for<'a> Fn(&'a mut [Width]), ) -> &mut TypstText
fn set_stroke_width(&mut self, width: f32) -> &mut TypstText
Source§impl StrokeWidth for VItem
impl StrokeWidth for VItem
fn stroke_width(&self) -> f32
fn apply_stroke_func( &mut self, f: impl for<'a> Fn(&'a mut [Width]), ) -> &mut VItem
Source§impl<I, G> StrokeWidth for Node<I, G>where
I: StrokeWidth,
impl<I, G> StrokeWidth for Node<I, G>where
I: StrokeWidth,
Source§fn stroke_width(&self) -> f32
fn stroke_width(&self) -> f32
The stroke width of the first leaf in DFS order; an empty tree warns
and reports 0.0.