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 HazardEntity
s.
Used in ‘collision collection’ queries to avoid having to repeatedly check hazards induced by an already detected entity.
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 Methods§
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.