Skip to main content

IsEditablePolygon

Trait IsEditablePolygon 

Source
pub trait IsEditablePolygon<V>: IsPolygon<V> {
    // Required methods
    fn add_vertex(&mut self, vertex: V) -> VId;
    fn change_vertex(&mut self, vid: VId, vertex: V) -> Result<()>;
}
Expand description

IsEditablePolygon trait used for polygons which can be edited

Required Methods§

Source

fn add_vertex(&mut self, vertex: V) -> VId

Should add a vertex to the end and return its id

Source

fn change_vertex(&mut self, vid: VId, vertex: V) -> Result<()>

Should change vertex at vId to the given vertex returning an error on failure

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<P> IsEditablePolygon<P> for Polygon2D<P>
where P: Is2D + Clone,

Source§

impl<P> IsEditablePolygon<P> for Polygon3D<P>
where P: Is3D + Clone,