Trait HazardDetector

Source
pub trait HazardDetector: HazardFilter {
    // Required methods
    fn contains(&self, haz: &HazardEntity) -> bool;
    fn push(&mut self, haz: HazardEntity);
    fn remove(&mut self, haz: &HazardEntity);
    fn len(&self) -> usize;
    fn iter(&self) -> impl Iterator<Item = &HazardEntity>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Trait for structs that can track and store detected HazardEntitys. Used in ‘collision collection’ queries to avoid having to repeatedly check hazards induced by an already detected entity.

Required Methods§

Source

fn contains(&self, haz: &HazardEntity) -> bool

Source

fn push(&mut self, haz: HazardEntity)

Source

fn remove(&mut self, haz: &HazardEntity)

Source

fn len(&self) -> usize

Source

fn iter(&self) -> impl Iterator<Item = &HazardEntity>

Provided Methods§

Source

fn is_empty(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§