#[non_exhaustive]pub enum DrawCommand {
Circle(Circle),
Rect(RectShape),
Line(Line),
Polyline(Polyline),
}Expand description
Renderable primitive command.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Circle(Circle)
Filled and/or stroked circle.
Rect(RectShape)
Filled and/or stroked rectangle.
Line(Line)
Single stroked segment.
Polyline(Polyline)
Connected stroked segments.
Implementations§
Source§impl DrawCommand
impl DrawCommand
Sourcepub const fn primitive(&self) -> ScenePrimitive
pub const fn primitive(&self) -> ScenePrimitive
Returns the primitive category used by diagnostics and budgets.
Sourcepub fn circle(
center: Vec2,
radius: f32,
style: ShapeStyle,
) -> Result<Self, SceneError>
pub fn circle( center: Vec2, radius: f32, style: ShapeStyle, ) -> Result<Self, SceneError>
Builds and validates a circle command for batch insertion.
Sourcepub fn rect(
rect: Rect,
corner_radius: f32,
style: ShapeStyle,
) -> Result<Self, SceneError>
pub fn rect( rect: Rect, corner_radius: f32, style: ShapeStyle, ) -> Result<Self, SceneError>
Builds and validates a rectangle command for batch insertion.
Sourcepub fn line(
from: Vec2,
to: Vec2,
width: f32,
color: Color,
) -> Result<Self, SceneError>
pub fn line( from: Vec2, to: Vec2, width: f32, color: Color, ) -> Result<Self, SceneError>
Builds and validates a single line command for batch insertion.
Sourcepub fn styled_line(
from: Vec2,
to: Vec2,
style: StrokeStyle2d,
) -> Result<Self, SceneError>
pub fn styled_line( from: Vec2, to: Vec2, style: StrokeStyle2d, ) -> Result<Self, SceneError>
Builds and validates an explicitly styled line command.
Sourcepub fn polyline(
points: Vec<Vec2>,
width: f32,
color: Color,
) -> Result<Self, SceneError>
pub fn polyline( points: Vec<Vec2>, width: f32, color: Color, ) -> Result<Self, SceneError>
Builds and validates a connected polyline command for batch insertion.
Sourcepub fn styled_polyline(
points: Vec<Vec2>,
style: StrokeStyle2d,
) -> Result<Self, SceneError>
pub fn styled_polyline( points: Vec<Vec2>, style: StrokeStyle2d, ) -> Result<Self, SceneError>
Builds and validates an explicitly styled polyline command.
Trait Implementations§
Source§impl Clone for DrawCommand
impl Clone for DrawCommand
Source§fn clone(&self) -> DrawCommand
fn clone(&self) -> DrawCommand
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DrawCommand
impl RefUnwindSafe for DrawCommand
impl Send for DrawCommand
impl Sync for DrawCommand
impl Unpin for DrawCommand
impl UnsafeUnpin for DrawCommand
impl UnwindSafe for DrawCommand
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