pub struct GuardEdge { /* private fields */ }Expand description
One exposed edge of a walking surface, and what sits near it.
Implementations§
Source§impl GuardEdge
impl GuardEdge
pub fn new( surface: ObjectId, barriers: Vec<GuardCandidate>, landings: Vec<GuardCandidate>, climbables: Vec<ClimbableCandidate>, ) -> Self
pub fn surface(&self) -> &ObjectId
pub fn barriers(&self) -> &[GuardCandidate]
pub fn landings(&self) -> &[GuardCandidate]
pub fn climbables(&self) -> &[ClimbableCandidate]
Sourcepub fn covered_fraction(
candidates: &[GuardCandidate],
maximum_gap_metres: f64,
) -> f64
pub fn covered_fraction( candidates: &[GuardCandidate], maximum_gap_metres: f64, ) -> f64
Fraction of this edge covered by candidates whose gap is within
maximum_gap_metres, unioning overlapping intervals.
Union rather than sum: two barriers covering the same half of an edge guard half of it, not all of it. Summing would let overlapping rails hide an unguarded run.
Trait Implementations§
impl StructuralPartialEq for GuardEdge
Auto Trait Implementations§
impl Freeze for GuardEdge
impl RefUnwindSafe for GuardEdge
impl Send for GuardEdge
impl Sync for GuardEdge
impl Unpin for GuardEdge
impl UnsafeUnpin for GuardEdge
impl UnwindSafe for GuardEdge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more