jagua_rs::collision_detection::hazard_helpers

Trait HazardDetector

Source
pub trait HazardDetector: HazardIgnorer {
    // 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 already detected hazards. Interface made to mimic a Vec of HazardEntitys.

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§