pub trait PlanSpanService:
Send
+ Sync
+ 'static {
// Required methods
fn measure_diameter(
&self,
object: &ObjectId,
) -> Result<PlanLength, PlanSpanError>;
fn measure_span(
&self,
first: &ObjectId,
second: &ObjectId,
between: PlanSpan,
) -> Result<PlanLength, PlanSpanError>;
// Provided methods
fn measure_centre(
&self,
object: &ObjectId,
) -> Result<PlanCentre, PlanSpanError> { ... }
fn measure_rectangle(
&self,
object: &ObjectId,
) -> Result<PlanRectangle, PlanSpanError> { ... }
fn measure_recesses(
&self,
object: &ObjectId,
) -> Result<PlanRecesses, PlanSpanError> { ... }
fn measure_section(
&self,
objects: &[ObjectId],
) -> Result<PlanSection, PlanSpanError> { ... }
fn measure_corridor_ends(
&self,
request: &CorridorEndRequest,
) -> Result<CorridorEnds, PlanSpanError> { ... }
fn measure_side_distances(
&self,
request: &SideDistanceRequest,
) -> Result<SideDistances, PlanSpanError> { ... }
}Expand description
Measures plan spans of model objects.
Required Methods§
Sourcefn measure_diameter(
&self,
object: &ObjectId,
) -> Result<PlanLength, PlanSpanError>
fn measure_diameter( &self, object: &ObjectId, ) -> Result<PlanLength, PlanSpanError>
The longest distance between two points of object’s footprint: its
longest plan diagonal. A footprint with no point has none, and is
refused, never zero.
Sourcefn measure_span(
&self,
first: &ObjectId,
second: &ObjectId,
between: PlanSpan,
) -> Result<PlanLength, PlanSpanError>
fn measure_span( &self, first: &ObjectId, second: &ObjectId, between: PlanSpan, ) -> Result<PlanLength, PlanSpanError>
The plan distance between the footprints of first and second,
measured between their centres or their farthest points.
Provided Methods§
Sourcefn measure_centre(&self, object: &ObjectId) -> Result<PlanCentre, PlanSpanError>
fn measure_centre(&self, object: &ObjectId) -> Result<PlanCentre, PlanSpanError>
The centroid of object’s footprint, the same centre
PlanSpan::Centres measures between, and whether it lies inside
the footprint. A service that does not locate centres refuses by
default, never answering with another point.
Sourcefn measure_rectangle(
&self,
object: &ObjectId,
) -> Result<PlanRectangle, PlanSpanError>
fn measure_rectangle( &self, object: &ObjectId, ) -> Result<PlanRectangle, PlanSpanError>
The rectangle of least area enclosing object’s footprint. A
service that does not orient footprints refuses by default, never
answering with the footprint’s axis-aligned box.
Sourcefn measure_recesses(
&self,
object: &ObjectId,
) -> Result<PlanRecesses, PlanSpanError>
fn measure_recesses( &self, object: &ObjectId, ) -> Result<PlanRecesses, PlanSpanError>
The recesses of object’s footprint: the pockets between its outer
boundary and its convex hull. A service that does not find recesses
refuses by default, never answering that there are none.
Sourcefn measure_section(
&self,
objects: &[ObjectId],
) -> Result<PlanSection, PlanSpanError>
fn measure_section( &self, objects: &[ObjectId], ) -> Result<PlanSection, PlanSpanError>
The plan section objects share: the intersection of their
footprints, its area and its minimum-area rectangle. A service that
does not intersect footprints refuses by default.
Sourcefn measure_corridor_ends(
&self,
request: &CorridorEndRequest,
) -> Result<CorridorEnds, PlanSpanError>
fn measure_corridor_ends( &self, request: &CorridorEndRequest, ) -> Result<CorridorEnds, PlanSpanError>
The ends of the paths through the request’s space footprint, the
wall each runs into, and the request’s subjects measured against
every decided wall (see CorridorEnds). A service that does not
find corridor ends refuses by default, never answering with none.
Sourcefn measure_side_distances(
&self,
request: &SideDistanceRequest,
) -> Result<SideDistances, PlanSpanError>
fn measure_side_distances( &self, request: &SideDistanceRequest, ) -> Result<SideDistances, PlanSpanError>
The request’s candidates beside each side of its object’s
least-area rectangle, and how far from its centre lines (see
SideDistances). A service that does not measure them refuses by
default, never answering with none.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".