StrokeWidth

Trait StrokeWidth 

Source
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§

Source

fn stroke_width(&self) -> f32

Get the stroke width

Source

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§

Source

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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl StrokeWidth for VItem

Source§

fn stroke_width(&self) -> f32

Source§

fn apply_stroke_func( &mut self, f: impl for<'a> Fn(&'a mut [Width]), ) -> &mut VItem

Source§

impl StrokeWidth for SvgItem

Source§

fn stroke_width(&self) -> f32

Source§

fn apply_stroke_func( &mut self, f: impl for<'a> Fn(&'a mut [Width]), ) -> &mut SvgItem

Source§

fn set_stroke_width(&mut self, width: f32) -> &mut SvgItem

Source§

impl StrokeWidth for TypstText

Source§

fn stroke_width(&self) -> f32

Source§

fn apply_stroke_func( &mut self, f: impl for<'a> Fn(&'a mut [Width]), ) -> &mut TypstText

Source§

fn set_stroke_width(&mut self, width: f32) -> &mut TypstText

Source§

impl<T> StrokeWidth for [T]
where T: StrokeWidth,

Source§

fn stroke_width(&self) -> f32

Source§

fn apply_stroke_func(&mut self, f: impl for<'a> Fn(&'a mut [Width])) -> &mut [T]

Implementors§