#[non_exhaustive]pub enum QueryValue {
Show 17 variants
Text(String),
TextRaw {
bytes: Vec<u8>,
csfrm: u8,
},
Raw(Vec<u8>),
Rowid(String),
BinaryDouble(String),
IntervalDS {
days: i32,
hours: i32,
minutes: i32,
seconds: i32,
fseconds: i32,
},
IntervalYM {
years: i32,
months: i32,
},
Number(OracleNumber),
Boolean(bool),
Cursor(Box<CursorValue>),
DateTime {
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanosecond: u32,
},
TimestampTz {
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanosecond: u32,
offset_minutes: i32,
},
Object(Box<ObjectValue>),
Lob(Box<LobValue>),
Vector(Box<Vector>),
Json(Box<OsonValue>),
Array(Vec<Option<QueryValue>>),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Text(String)
TextRaw
Character data that could not be decoded as valid text; the raw bytes
are preserved so the caller can apply an encoding_errors policy.
Raw(Vec<u8>)
Rowid(String)
BinaryDouble(String)
IntervalDS
IntervalYM
Number(OracleNumber)
Oracle NUMBER / BINARY_INTEGER. The lossless decimal value is carried
inline as a { coefficient: i128, scale: i16 } form (no per-cell heap
allocation for the common case), with a boxed text fallback for the rare
value that does not fit inline. See OracleNumber.
Boolean(bool)
Native Oracle DB_TYPE_BOOLEAN (ora_type_num 252, 23ai+): surfaced as
a Python bool rather than an integer.
Cursor(Box<CursorValue>)
REF CURSOR (cold): payload boxed, see CursorValue.
DateTime
TimestampTz
Fields
Object(Box<ObjectValue>)
ADT / collection image (cold): payload boxed, see ObjectValue.
Lob(Box<LobValue>)
LOB / BFILE locator (cold): payload boxed, see LobValue.
Vector(Box<Vector>)
VECTOR (cold): the per-element data is boxed out of the hot enum.
Json(Box<OsonValue>)
Native Oracle JSON (DB_TYPE_JSON, ora_type_num 119): the OSON image
is decoded eagerly into the lossless crate::oson::OsonValue tree
(cold): the tree is boxed out of the hot enum.
Array(Vec<Option<QueryValue>>)
Implementations§
Source§impl QueryValue
impl QueryValue
Sourcepub fn number_from_text(text: &str, is_integer: bool) -> Self
pub fn number_from_text(text: &str, is_integer: bool) -> Self
Construct a NUMBER value from already-canonical decimal text and an
explicit is_integer flag. Convenience for binds / tests that hold the
canonical text; folds into the inline form when it fits. The text MUST be
canonical Oracle NUMBER text (the form the decoder emits).
Sourcepub fn as_text(&self) -> Option<&str>
pub fn as_text(&self) -> Option<&str>
Borrow this value as decoded text when it is a VARCHAR2 / CHAR /
NVARCHAR2 / CLOB-inlined string, otherwise None. Convenience
accessor for callers that want to avoid matching the full enum.
Sourcepub fn as_i64(&self) -> Option<i64>
pub fn as_i64(&self) -> Option<i64>
Interpret this value as a 64-bit integer. Works for NUMBER values
whose canonical text parses as an i64, and for the native
DB_TYPE_BOOLEAN (true -> 1, false -> 0). Returns None for any
other variant, or a NUMBER that does not fit / is not integral.
Sourcepub fn as_f64(&self) -> Option<f64>
pub fn as_f64(&self) -> Option<f64>
Interpret this value as an f64. Works for NUMBER, BINARY_DOUBLE
and BINARY_FLOAT (all carried as canonical text), otherwise None.
Sourcepub fn as_number_text(&self) -> Option<Cow<'_, str>>
pub fn as_number_text(&self) -> Option<Cow<'_, str>>
The canonical decimal text of a NUMBER value (lossless, arbitrary
precision), otherwise None. The owned inline form synthesizes the text
on demand via the shared formatter, so this returns an owned Cow.
Sourcepub fn as_number(&self) -> Option<&OracleNumber>
pub fn as_number(&self) -> Option<&OracleNumber>
Borrow the inline NUMBER representation, otherwise None.
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Return the boolean of a native DB_TYPE_BOOLEAN value, otherwise
None.
Sourcepub fn as_rowid(&self) -> Option<&str>
pub fn as_rowid(&self) -> Option<&str>
Borrow the encoded text of a ROWID / UROWID value, otherwise
None.
Sourcepub fn variant_name(&self) -> &'static str
pub fn variant_name(&self) -> &'static str
A short, stable name for this value’s variant (e.g. "Text", "Number").
Lets callers identify a fetched cell’s shape for logging / diagnostics
without an exhaustive match that would break the moment a variant is
added. The match lives inside the defining crate, so it stays the single
exhaustiveness tripwire that flags a new variant at compile time.
Trait Implementations§
Source§impl Clone for QueryValue
impl Clone for QueryValue
Source§fn clone(&self) -> QueryValue
fn clone(&self) -> QueryValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QueryValue
impl Debug for QueryValue
Source§impl PartialEq for QueryValue
impl PartialEq for QueryValue
Source§fn eq(&self, other: &QueryValue) -> bool
fn eq(&self, other: &QueryValue) -> bool
self and other values to be equal, and is used by ==.