#[non_exhaustive]pub enum PathError<S> {
OutOfDomain {
param: S,
domain: RangeInclusive<S>,
},
NotDifferentiable {
param: S,
reason: &'static str,
},
Degenerate {
reason: &'static str,
},
Custom(&'static str),
}Expand description
Errors that can occur during path sampling or geometric queries.
The scalar parameter S allows the error to carry the exact parameter value
and domain that caused the failure, making diagnostics precise.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
OutOfDomain
Arc-length / parameter outside the valid domain.
Fields
param: SThe parameter value that was out of domain.
domain: RangeInclusive<S>The valid domain [start, end].
NotDifferentiable
The path is not differentiable at param (e.g. a cusp or kink).
Fields
param: SThe parameter where differentiability fails.
Degenerate
The path is degenerate (e.g. zero-length segment, collinear control points).
Custom(&'static str)
A custom error with a static description for implementer-specific failures.
Implementations§
Source§impl<S: Scalar> PathError<S>
impl<S: Scalar> PathError<S>
Sourcepub fn out_of_domain(param: S, domain: RangeInclusive<S>) -> Self
pub fn out_of_domain(param: S, domain: RangeInclusive<S>) -> Self
Create an OutOfDomain error with the offending parameter and valid domain.
Sourcepub fn not_differentiable(param: S, reason: &'static str) -> Self
pub fn not_differentiable(param: S, reason: &'static str) -> Self
Create a NotDifferentiable error with the parameter and reason.
Sourcepub fn degenerate(reason: &'static str) -> Self
pub fn degenerate(reason: &'static str) -> Self
Create a Degenerate error with a reason.
Trait Implementations§
Source§impl<S: Debug> Error for PathError<S>
impl<S: Debug> Error for PathError<S>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()