pub trait Shape2D {
type Value;
type VertexIterator<'a>: Iterator<Item = Point<Self::Value>>
where Self: 'a;
type LineIterator<'a>: Iterator<Item = Line<Self::Value>>
where Self: 'a;
// Required methods
fn is_valid(&self) -> bool;
fn boundary(&self) -> Rectangle<Self::Value>;
fn vertices<'a>(&'a self, sample: usize) -> Self::VertexIterator<'a>;
fn edges<'a>(&'a self, sample: usize) -> Self::LineIterator<'a>;
// Provided method
fn normalize(&mut self) -> bool { ... }
}
Required Associated Types§
Sourcetype VertexIterator<'a>: Iterator<Item = Point<Self::Value>>
where
Self: 'a
type VertexIterator<'a>: Iterator<Item = Point<Self::Value>> where Self: 'a
The value type of the shape.
Sourcetype LineIterator<'a>: Iterator<Item = Line<Self::Value>>
where
Self: 'a
type LineIterator<'a>: Iterator<Item = Line<Self::Value>> where Self: 'a
The value type of the shape.
Required Methods§
Sourcefn vertices<'a>(&'a self, sample: usize) -> Self::VertexIterator<'a>
fn vertices<'a>(&'a self, sample: usize) -> Self::VertexIterator<'a>
Returns the owned vertices of the shape.
Notice that sample only works for non-linear shapes.
Sourcefn edges<'a>(&'a self, sample: usize) -> Self::LineIterator<'a>
fn edges<'a>(&'a self, sample: usize) -> Self::LineIterator<'a>
Returns the owned edges of the shape.
Provided Methods§
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.