#[non_exhaustive]pub enum ValidationError {
EmptyField {
field: &'static str,
},
InvalidHttpHeaderValue {
field: &'static str,
},
InvalidHexPrefix {
field: &'static str,
},
InvalidHexLength {
field: &'static str,
expected: usize,
},
InvalidHexCharacters {
field: &'static str,
},
InvalidNumeric {
field: &'static str,
},
NumericOverflow {
field: &'static str,
},
UnsupportedChain {
chain_id: u64,
},
ValidToOutOfRange {
actual_seconds: u64,
},
DecimalsOutOfRange {
actual: u8,
max: u8,
},
}Expand description
Validation failures for typed user input and configuration values.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyField
A required string or collection field was empty after validation.
InvalidHttpHeaderValue
A value could not be serialized into a valid HTTP header.
InvalidHexPrefix
A hexadecimal value did not include the required 0x prefix.
InvalidHexLength
A fixed-length hexadecimal value had the wrong number of hex characters.
Fields
InvalidHexCharacters
A hexadecimal value contained non-hex characters.
InvalidNumeric
A decimal or hexadecimal numeric value could not be parsed.
NumericOverflow
A parsed numeric value exceeded the supported uint256 range.
UnsupportedChain
A chain id was not part of the supported CoW Protocol network set.
ValidToOutOfRange
A valid_to timestamp exceeded the protocol-fixed u32 epoch ceiling.
DecimalsOutOfRange
A decimals scale passed to Amount::parse_units was above the
maximum representable value.
The maximum is 77 because 10^77 < 2^256 - 1 < 10^78, so any
decimals value above 77 would make 10^decimals overflow the
inner uint256 that backs Amount. Every ERC-20 token across the
supported chains ships decimals <= 18, so the bound is structurally
satisfied in practice; the explicit error fails closed at
construction time instead of saturating or panicking.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
impl Eq for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
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()
Source§impl From<ValidationError> for CoreError
impl From<ValidationError> for CoreError
Source§fn from(source: ValidationError) -> Self
fn from(source: ValidationError) -> Self
Source§impl PartialEq for ValidationError
impl PartialEq for ValidationError
Source§fn eq(&self, other: &ValidationError) -> bool
fn eq(&self, other: &ValidationError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ValidationError
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
impl UnwindSafe for ValidationError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.