Skip to main content

GuardSearch

Struct GuardSearch 

Source
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

Source

pub fn try_new( candidate_radius_metres: f64, sample_spacing_metres: f64, ) -> Result<Self, GuardError>

Source

pub fn with_surfaces(self, surfaces: Vec<ObjectId>) -> Self

Asks for these walking surfaces to be measured, in canonical order.

Source

pub fn with_barrier_candidates(self, barriers: Vec<ObjectId>) -> Self

Restricts barriers to these objects. An empty set admits none.

Source

pub fn with_landing_candidates(self, landings: Vec<ObjectId>) -> Self

Restricts landings to these objects. An empty set admits none.

Source

pub fn with_climbable_candidates(self, climbables: Vec<ObjectId>) -> Self

Restricts climbing aids to these objects. An empty set admits none.

Source

pub fn surfaces(&self) -> &[ObjectId]

Walking surfaces the caller asks to be measured.

Source

pub fn barrier_candidates(&self) -> Option<&[ObjectId]>

Objects allowed to count as barriers, or None when any body may.

Source

pub fn landing_candidates(&self) -> Option<&[ObjectId]>

Objects allowed to count as landings, or None when any body may.

Source

pub fn climbable_candidates(&self) -> Option<&[ObjectId]>

Objects allowed to count as climbing aids, or None when any body may.

Source

pub fn admits_barrier(&self, object: &ObjectId) -> bool

Whether object may be reported as a barrier.

Source

pub fn admits_landing(&self, object: &ObjectId) -> bool

Whether object may be reported as a landing.

Source

pub fn admits_climbable(&self, object: &ObjectId) -> bool

Whether object may be reported as a climbing aid.

Source

pub fn candidate_radius_metres(&self) -> f64

Source

pub fn sample_spacing_metres(&self) -> f64

Trait Implementations§

Source§

impl Clone for GuardSearch

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GuardSearch

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for GuardSearch

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GuardSearch

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.