//! Definitions used in derived implementations of [`core::ops`] traits.
use core::fmt;
/// Error returned by the derived implementations when an arithmetic or logic /// operation is invoked on a unit-like variant of an enum. #[derive(Clone, Copy, Debug)] pubstruct UnitError {
operation_name: &'static str,
}
#[cfg(feature = "std")] impl std::error::Error for UnitError {}
#[cfg(feature = "add")] /// Error returned by the derived implementations when an arithmetic or logic /// operation is invoked on mismatched enum variants. #[derive(Clone, Copy, Debug)] pubstruct WrongVariantError {
operation_name: &'static str,
}
#[cfg(feature = "add")] /// Possible errors returned by the derived implementations of binary /// arithmetic or logic operations. #[derive(Clone, Copy, Debug)] pubenum BinaryError { /// Operation is attempted between mismatched enum variants.
Mismatch(WrongVariantError),
/// Operation is attempted on unit-like enum variants.
Unit(UnitError),
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.