pub enum TestResult {
Pass,
Fail(GeometricError),
Skipped(String),
}Expand description
Result of a geometric test
Unlike boolean tests, geometric tests provide rich error information when they fail, including distance from expected manifold and correction vectors.
Variants§
Pass
Test passed - state lies on expected manifold
Fail(GeometricError)
Test failed with geometric error information
Skipped(String)
Test was skipped (e.g., precondition not met)
Implementations§
Source§impl TestResult
impl TestResult
Sourcepub fn error(&self) -> Option<&GeometricError>
pub fn error(&self) -> Option<&GeometricError>
Get the error if test failed
Sourcepub fn fail(error: GeometricError) -> Self
pub fn fail(error: GeometricError) -> Self
Create a fail result from geometric error
Sourcepub fn fail_with_distance(distance: f64, description: impl Into<String>) -> Self
pub fn fail_with_distance(distance: f64, description: impl Into<String>) -> Self
Create a fail result from distance and description
Sourcepub fn into_result(self) -> Result<(), GeometricError>
pub fn into_result(self) -> Result<(), GeometricError>
Convert to standard Result type for use with ?
Sourcepub fn combine(results: impl IntoIterator<Item = TestResult>) -> Self
pub fn combine(results: impl IntoIterator<Item = TestResult>) -> Self
Combine multiple test results
Returns Pass only if all results are Pass. Returns the first Fail if any failed.
Trait Implementations§
Source§impl Clone for TestResult
impl Clone for TestResult
Source§fn clone(&self) -> TestResult
fn clone(&self) -> TestResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TestResult
impl Debug for TestResult
Source§impl<'de> Deserialize<'de> for TestResult
impl<'de> Deserialize<'de> for TestResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<TestResult> for bool
impl From<TestResult> for bool
Source§fn from(result: TestResult) -> Self
fn from(result: TestResult) -> Self
Converts to this type from the input type.
Source§impl From<bool> for TestResult
impl From<bool> for TestResult
Auto Trait Implementations§
impl Freeze for TestResult
impl RefUnwindSafe for TestResult
impl Send for TestResult
impl Sync for TestResult
impl Unpin for TestResult
impl UnsafeUnpin for TestResult
impl UnwindSafe for TestResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more