pub struct GuardSearch { /* private fields */ }Expand description
How far to look for candidates, how finely to sample an edge, which walking surfaces to measure, and which objects may play each role.
Measurement inputs, not thresholds: these bound the search, they do not judge what is found. The surfaces come from the rule’s selection, so which edges are checked for fall protection is stated in the ruleset rather than guessed by a host.
The candidate sets work the same way. A mesh does not say whether a body is a railing or a cupboard, so without them any nearby body counts as a barrier, landing or climbing aid. A set that is present restricts that role to its members; an absent set leaves the role open to every body.
Implementations§
Source§impl GuardSearch
impl GuardSearch
pub fn try_new( candidate_radius_metres: f64, sample_spacing_metres: f64, ) -> Result<Self, GuardError>
Sourcepub fn with_surfaces(self, surfaces: Vec<ObjectId>) -> Self
pub fn with_surfaces(self, surfaces: Vec<ObjectId>) -> Self
Asks for these walking surfaces to be measured, in canonical order.
Sourcepub fn with_barrier_candidates(self, barriers: Vec<ObjectId>) -> Self
pub fn with_barrier_candidates(self, barriers: Vec<ObjectId>) -> Self
Restricts barriers to these objects. An empty set admits none.
Sourcepub fn with_landing_candidates(self, landings: Vec<ObjectId>) -> Self
pub fn with_landing_candidates(self, landings: Vec<ObjectId>) -> Self
Restricts landings to these objects. An empty set admits none.
Sourcepub fn with_climbable_candidates(self, climbables: Vec<ObjectId>) -> Self
pub fn with_climbable_candidates(self, climbables: Vec<ObjectId>) -> Self
Restricts climbing aids to these objects. An empty set admits none.
Sourcepub fn barrier_candidates(&self) -> Option<&[ObjectId]>
pub fn barrier_candidates(&self) -> Option<&[ObjectId]>
Objects allowed to count as barriers, or None when any body may.
Sourcepub fn landing_candidates(&self) -> Option<&[ObjectId]>
pub fn landing_candidates(&self) -> Option<&[ObjectId]>
Objects allowed to count as landings, or None when any body may.
Sourcepub fn climbable_candidates(&self) -> Option<&[ObjectId]>
pub fn climbable_candidates(&self) -> Option<&[ObjectId]>
Objects allowed to count as climbing aids, or None when any body may.
Sourcepub fn admits_barrier(&self, object: &ObjectId) -> bool
pub fn admits_barrier(&self, object: &ObjectId) -> bool
Whether object may be reported as a barrier.
Sourcepub fn admits_landing(&self, object: &ObjectId) -> bool
pub fn admits_landing(&self, object: &ObjectId) -> bool
Whether object may be reported as a landing.
Sourcepub fn admits_climbable(&self, object: &ObjectId) -> bool
pub fn admits_climbable(&self, object: &ObjectId) -> bool
Whether object may be reported as a climbing aid.