pub enum OsonValue {
Null,
Bool(bool),
Number(String),
BinaryFloat(f32),
BinaryDouble(f64),
String(String),
Raw(Vec<u8>),
DateTime {
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanosecond: u32,
},
IntervalDS {
days: i32,
hours: i32,
minutes: i32,
seconds: i32,
fseconds: i32,
},
Vector(Vector),
Array(Vec<OsonValue>),
Object(Vec<(String, OsonValue)>),
}Expand description
A fully-decoded JSON value preserving every Oracle scalar type that OSON can
carry. This is the lossless intermediate the protocol crate produces; the
Python-facing layer maps it to dict/list/datetime/Decimal/bytes.
We deliberately do not collapse to serde_json::Value: OSON distinguishes
BinaryFloat from BinaryDouble from Number (an Oracle NUMBER carried as
text to preserve arbitrary precision), and carries Date/Timestamp/
IntervalDS/Raw scalars that JSON cannot represent. Object key order is
preserved as insertion order, matching python-oracledb’s dict semantics.
Variants§
Null
Bool(bool)
Number(String)
An Oracle NUMBER as its canonical decimal text (e.g. “25.25”, “319438950232418390.273596”). Carrying text keeps arbitrary precision.
BinaryFloat(f32)
BinaryDouble(f64)
String(String)
UTF-8 string.
Raw(Vec<u8>)
Raw bytes ($rawhex / Python bytes).
DateTime
DATE / TIMESTAMP decoded to civil components (no time zone applied
beyond the OSON normalization done by decode_datetime_value).
IntervalDS
INTERVAL DAY TO SECOND.
Vector(Vector)
A VECTOR embedded in JSON (extended node type).
Array(Vec<OsonValue>)
Object(Vec<(String, OsonValue)>)
Object with insertion-ordered keys.