pub trait Boundary:
Clone
+ Send
+ Sync {
type Scalar: RealField + Copy;
// Required methods
fn measure(&self) -> Self::Scalar;
fn aabb_vec(&self) -> (Vec<Self::Scalar>, Vec<Self::Scalar>);
fn validate(&self) -> Result<(), Error>;
fn contains_point(&self, point: &[Self::Scalar]) -> bool;
// Provided method
fn aabb(&self) -> ([Self::Scalar; 2], [Self::Scalar; 2]) { ... }
}Expand description
Trait for boundaries/containers that hold geometries.
Required Associated Types§
Required Methods§
Sourcefn aabb_vec(&self) -> (Vec<Self::Scalar>, Vec<Self::Scalar>)
fn aabb_vec(&self) -> (Vec<Self::Scalar>, Vec<Self::Scalar>)
Returns the axis-aligned bounding box as Vec.
Sourcefn validate(&self) -> Result<(), Error>
fn validate(&self) -> Result<(), Error>
Validates the boundary and returns an error if invalid.
Sourcefn contains_point(&self, point: &[Self::Scalar]) -> bool
fn contains_point(&self, point: &[Self::Scalar]) -> bool
Checks if a point is inside the boundary.
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.