pub enum WholeFloats {
Reject,
Coerce,
}Expand description
How to treat a whole number written with a fraction (20000.0) where the schema says
integer and the schema’s own draft does not count it as one.
Only the OCPP 1.6 core schemas are affected: they are JSON Schema draft-04, where an
integer is “a JSON number without a fraction or exponent part”. From draft-06 on —
every OCPP 2.0.1 and 2.1 schema, and the 1.6 security extensions — 20000.0 is an
integer, and the generated types accept it in every mode.
Variants§
Reject
Fail with DecodeErrorKind::Type, as draft-04 requires.
Coerce
Rewrite them as integers. A real fraction (20000.5) is never rewritten.
Trait Implementations§
Source§impl Clone for WholeFloats
impl Clone for WholeFloats
impl Copy for WholeFloats
Source§impl Debug for WholeFloats
impl Debug for WholeFloats
Source§impl Default for WholeFloats
impl Default for WholeFloats
impl Eq for WholeFloats
Source§impl PartialEq for WholeFloats
impl PartialEq for WholeFloats
impl StructuralPartialEq for WholeFloats
Auto Trait Implementations§
impl Forget for WholeFloats
impl Freeze for WholeFloats
impl Move for WholeFloats
impl RefUnwindSafe for WholeFloats
impl Send for WholeFloats
impl Sync for WholeFloats
impl Unpin for WholeFloats
impl UnsafeUnpin for WholeFloats
impl UnwindSafe for WholeFloats
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