Skip to main content

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".

Implementations on Foreign Types§

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 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<I, G> StrokeWidth for Node<I, G>
where I: StrokeWidth,

Source§

fn stroke_width(&self) -> f32

The stroke width of the first leaf in DFS order; an empty tree warns and reports 0.0.

Source§

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

Forward the stroke-width function to every leaf independently.

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§

Source§

impl<T, G> StrokeWidth for Transformed<T, G>
where T: StrokeWidth,