#[non_exhaustive]pub enum Input {
Json(Vec<u8>),
Yaml(Vec<u8>),
Value(Value),
}Expand description
The bytes or value a description arrives as.
The variant records where the numbers came from, because exactness
cannot be reconstructed after the fact: only Input::Json, which
this crate parses itself, can yield Fidelity::Exact. The YAML
reader may round through f64, and a ready-made Value has unknown
provenance whatever its caller believes about it. There is
deliberately no way to assert exactness on a Value.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Json(Vec<u8>)
JSON text. The only way to obtain exact numbers.
Yaml(Vec<u8>)
YAML text, read with serde-saphyr. An integer within the 64-bit
range is kept exactly; a fraction, an exponent, or an untagged
decimal integer past u64::MAX or below i64::MIN is read through
f64.
Value(Value)
An already-parsed value of unknown provenance.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Input
impl Freeze for Inputwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnsafeUnpin for Inputwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for Input
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