Enum atom_table::TransformResError
source · pub enum TransformResError<E> {
TransformFunctionError(E),
NonUniqueOutput(NonUniqueTransformOutputError),
}
Expand description
Wraps a user-provided error type to also allow returning NonUniqueTransformOutputError
.
E
is the transform function’s error type. That is, if
the transform function provided returns Result<U, E>
,
AtomTable<V, I>::try_transform_res
will have an error type of
TransformResError<E>
, with an overall return type of
Result<AtomTable<U, I>, TransformResError<E>>
.
Variants§
TransformFunctionError(E)
Wraps a user-provided error type used by a transform function.
NonUniqueOutput(NonUniqueTransformOutputError)
Wraps NonUniqueTransformOutputError
, returned when your function does not produce unique outputs.
Implementations§
source§impl<E> TransformResError<E>
impl<E> TransformResError<E>
sourcepub const fn as_non_unique_output(
&self
) -> Option<NonUniqueTransformOutputError>
pub const fn as_non_unique_output( &self ) -> Option<NonUniqueTransformOutputError>
Gets the contained NonUniqueTransformOutputError
if applicable.
Returns Some(NonUniqueTransformOutputError)
if this is TransformResError::NonUniqueOutput
,
None
otherwise.
sourcepub const fn as_transform_function_error(&self) -> Option<&E>
pub const fn as_transform_function_error(&self) -> Option<&E>
Gets the contained error returned by the provided function, if applicable.
Returns Some
if this is TransformResError::TransformFunctionError
,
None
otherwise.