Enum libreda_pnr::db::Geometry[][src]

pub enum Geometry<T> {
    Point(Point<T>),
    Edge(Edge<T>),
    Rect(Rect<T>),
    SimplePolygon(SimplePolygon<T>),
    SimpleRPolygon(SimpleRPolygon<T>),
    Polygon(Polygon<T>),
    Path(Path<T>),
    Text(Text<T, String>),
}
Expand description

Abstracted geometrical shape.

Variants

Point(Point<T>)

Point.

Tuple Fields of Point

0: Point<T>
Edge(Edge<T>)

Edge.

Tuple Fields of Edge

0: Edge<T>
Rect(Rect<T>)

Rect.

Tuple Fields of Rect

0: Rect<T>
SimplePolygon(SimplePolygon<T>)

SimplePolygon.

Tuple Fields of SimplePolygon

0: SimplePolygon<T>
SimpleRPolygon(SimpleRPolygon<T>)

SimpleRPolygon.

Tuple Fields of SimpleRPolygon

0: SimpleRPolygon<T>
Polygon(Polygon<T>)

Polygon.

Tuple Fields of Polygon

0: Polygon<T>
Path(Path<T>)

Path.

Tuple Fields of Path

0: Path<T>
Text(Text<T, String>)

Text.

Tuple Fields of Text

0: Text<T, String>

Implementations

Create a transformed copy of the geometric object.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Area calculation.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Convert a geometry into a polygon.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Convert a geometry into a polygon.

The coordinate type must implement NumCast because there is currently no way to convert a Path into a polygon without converting it to a float type first.

Examples
use iron_shapes::prelude::*;
let rect = Rect::new((0, 0), (1, 2));
// Convert the rectangle to a `Geometry`.
let g: Geometry<_> = rect.into();
assert_eq!(g.to_polygon(), rect.to_polygon())

Calculate the bounding box of this geometrical shape by calling the bounding box method of the concrete type.

Output type of the cast. This is likely the same geometrical type just with other coordinate types. Read more

Try to cast to target data type. Read more

Cast to target data type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.