pub struct FloatHandler;Expand description
Floating-point validation handler.
Implementations§
Source§impl FloatHandler
impl FloatHandler
Sourcepub fn validate_and_canonicalize(
value: &str,
range: Option<&[f64; 2]>,
field_name: &str,
) -> Result<String>
pub fn validate_and_canonicalize( value: &str, range: Option<&[f64; 2]>, field_name: &str, ) -> Result<String>
Validates a floating-point field, applies optional inclusive range checks, and returns a canonical string representation.
Valid example: "12.5" -> "12.5".
Invalid example: "NaN" -> error.
Canonicalization uses Rust’s shortest round-trippable decimal formatting.
Non-finite values (NaN, inf, -inf) are rejected.
Auto Trait Implementations§
impl Freeze for FloatHandler
impl RefUnwindSafe for FloatHandler
impl Send for FloatHandler
impl Sync for FloatHandler
impl Unpin for FloatHandler
impl UnsafeUnpin for FloatHandler
impl UnwindSafe for FloatHandler
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