mirror of
https://github.com/floor-licker/polyfill-rs.git
synced 2026-08-15 21:48:06 +00:00
feat:implement rfq endpoints
This commit is contained in:
@@ -173,6 +173,19 @@ pub mod deserializers {
|
||||
_ => Ok(None),
|
||||
}
|
||||
}
|
||||
|
||||
/// Deserialize a Decimal from string/number.
|
||||
///
|
||||
/// - `""` => error
|
||||
/// - invalid values => error
|
||||
pub fn decimal_from_string<'de, D>(deserializer: D) -> std::result::Result<Decimal, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
optional_decimal_from_string(deserializer)?.ok_or_else(|| {
|
||||
serde::de::Error::custom("Expected decimal as string/number, got null/empty string")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// Raw API response types for efficient parsing
|
||||
|
||||
Reference in New Issue
Block a user