pub struct CanvasDrawableShape {
pub shape: Shape,
pub stroke_style: String,
pub line_width: f32,
}Expand description
Canvas-optimized representation of a drawable shape.
This structure is designed for efficient use in JavaScript/Canvas contexts where stroke styles are represented as strings rather than structured data.
Typically this is constructed from a DrawableShape on the client immediately before rendering.
Fields§
§shape: ShapeThe geometric shape to draw
stroke_style: StringStroke style as a CSS-compatible string
line_width: f32Line width for drawing the shape outline
Trait Implementations§
Source§impl Clone for CanvasDrawableShape
impl Clone for CanvasDrawableShape
Source§fn clone(&self) -> CanvasDrawableShape
fn clone(&self) -> CanvasDrawableShape
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CanvasDrawableShape
impl Debug for CanvasDrawableShape
Source§impl<'de> Deserialize<'de> for CanvasDrawableShape
impl<'de> Deserialize<'de> for CanvasDrawableShape
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<DrawableShape> for CanvasDrawableShape
impl From<DrawableShape> for CanvasDrawableShape
Source§fn from(orig: DrawableShape) -> CanvasDrawableShape
fn from(orig: DrawableShape) -> CanvasDrawableShape
Converts a DrawableShape to a CanvasDrawableShape.
This conversion prepares the shape for use in canvas rendering contexts by converting the structured stroke style to a CSS string.
Source§impl PartialEq for CanvasDrawableShape
impl PartialEq for CanvasDrawableShape
Source§impl Serialize for CanvasDrawableShape
impl Serialize for CanvasDrawableShape
impl StructuralPartialEq for CanvasDrawableShape
Auto Trait Implementations§
impl Freeze for CanvasDrawableShape
impl RefUnwindSafe for CanvasDrawableShape
impl Send for CanvasDrawableShape
impl Sync for CanvasDrawableShape
impl Unpin for CanvasDrawableShape
impl UnwindSafe for CanvasDrawableShape
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more