pub struct WalkabilitySnapshot { /* private fields */ }Implementations§
Source§impl WalkabilitySnapshot
impl WalkabilitySnapshot
pub fn try_new( request: WalkabilityRequest, regions: Vec<WalkabilityRegion>, passages: Vec<VerifiedWalkablePassage>, evidence: Evidence, ) -> Result<Self, WalkabilityError>
pub fn request(&self) -> &WalkabilityRequest
pub fn regions(&self) -> &[WalkabilityRegion]
pub fn passages(&self) -> &[VerifiedWalkablePassage]
pub fn evidence(&self) -> &Evidence
pub fn route_between( &self, from: &ObjectId, to: &ObjectId, ) -> Result<WalkabilityRouteOutcome, WalkabilityError>
Sourcepub fn route_between_avoiding(
&self,
from: &ObjectId,
to: &ObjectId,
forbidden: &[VerticalConnectorKind],
) -> Result<WalkabilityRouteOutcome, WalkabilityError>
pub fn route_between_avoiding( &self, from: &ObjectId, to: &ObjectId, forbidden: &[VerticalConnectorKind], ) -> Result<WalkabilityRouteOutcome, WalkabilityError>
Routes as Self::route_between, but never through a passage whose
vertical connector is of a forbidden kind. Forbidding
VerticalConnectorKind::Stair makes a stairs-only connection
unreachable.
§Errors
WalkabilityError::ObjectUnavailable when an endpoint is mapped to
no region.
Sourcepub fn route_between_admitting(
&self,
from: &ObjectId,
to: &ObjectId,
admit: impl Fn(&VerifiedWalkablePassage) -> PassageAdmission,
) -> Result<WalkabilityRouteOutcome, WalkabilityError>
pub fn route_between_admitting( &self, from: &ObjectId, to: &ObjectId, admit: impl Fn(&VerifiedWalkablePassage) -> PassageAdmission, ) -> Result<WalkabilityRouteOutcome, WalkabilityError>
Routes as Self::route_between, with a rule’s own judgement of
each passage on top of the width: the definite graph keeps only
passages it admits, the possible graph
drops only those it refuses. A rule
that cannot decide a passage (a door whose required width it cannot
read) can therefore only turn a verdict Indeterminate.
§Errors
WalkabilityError::ObjectUnavailable when an endpoint is mapped to
no region.
Sourcepub fn blocking_passages(
&self,
from: &ObjectId,
to: &ObjectId,
admit: impl Fn(&VerifiedWalkablePassage) -> PassageAdmission,
) -> Result<Vec<&VerifiedWalkablePassage>, WalkabilityError>
pub fn blocking_passages( &self, from: &ObjectId, to: &ObjectId, admit: impl Fn(&VerifiedWalkablePassage) -> PassageAdmission, ) -> Result<Vec<&VerifiedWalkablePassage>, WalkabilityError>
The passages that block every route from from to to: those
leaving the regions the possible graph reaches from from (too
narrow, or refused by admit) towards a region from which to can
be reached, widths and admission ignored, without re-entering them.
Empty when a possible route exists, and when nothing joins the two
at all.
Any route, once it last leaves the reached regions, crosses a returned passage: they form a cut, ordered as the snapshot orders its passages. A block that only guards some other region is left out.
§Errors
WalkabilityError::ObjectUnavailable when an endpoint is mapped to
no region.