#[non_exhaustive]pub enum BindValue {
Show 24 variants
Null,
TypedNull {
ora_type_num: u8,
csfrm: u8,
buffer_size: u32,
},
Output {
ora_type_num: u8,
csfrm: u8,
buffer_size: u32,
},
ReturnOutput {
ora_type_num: u8,
csfrm: u8,
buffer_size: u32,
},
InOut {
value: Box<BindValue>,
out_buffer_size: u32,
},
ObjectOutput {
schema: String,
type_name: String,
oid: Vec<u8>,
version: u32,
buffer_size: u32,
is_return: bool,
},
ObjectInput {
schema: String,
type_name: String,
oid: Vec<u8>,
version: u32,
image: Vec<u8>,
buffer_size: u32,
},
Text(String),
Raw(Vec<u8>),
Lob {
ora_type_num: u8,
csfrm: u8,
locator: Vec<u8>,
},
Number(String),
BinaryInteger(String),
BinaryDouble(f64),
BinaryFloat(f64),
Boolean(bool),
IntervalDS {
days: i32,
seconds: i32,
microseconds: i32,
},
IntervalYM {
years: i32,
months: i32,
},
DateTime {
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
},
Timestamp {
ora_type_num: u8,
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,
},
Array {
ora_type_num: u8,
csfrm: u8,
buffer_size: u32,
max_elements: u32,
values: Vec<Option<BindValue>>,
},
Vector(Vector),
Json(Vec<u8>),
Cursor {
cursor_id: u32,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Null
TypedNull
Output
ReturnOutput
InOut
A combined IN OUT bind: value is sent to the server as the input
(its Oracle type drives the wire bind type / charset form), and the same
bind position is read back as an output. out_buffer_size reserves room
for the returned value, which may exceed the input’s natural size (e.g. a
VARCHAR2 IN OUT whose input is shorter than the value the routine
writes back); the effective bind buffer is the max of the input’s natural
size and this field.
The bind direction is not encoded on the wire by the client. The server
derives IN OUT from the PL/SQL parameter mode and flags the position
TNS_BIND_DIR_INPUT_OUTPUT (48) in the returned IO vector; that flag is
what drives the read-back (parse_io_vector, keyed off
!= TNS_BIND_DIR_INPUT), exactly as for a plain OUT bind
(TNS_BIND_DIR_OUTPUT = 16). Encoding-wise an IN OUT bind is therefore an
input bind (the value bytes are written, never a null indicator) sized to
hold the output.
ObjectOutput
ObjectInput
A DbObject bound as IN (or IN/OUT). The fully packed pickle image is
built by the pyshim (it owns the recursive Python attribute values); the
protocol only frames it (toid/oid/snapshot/version/len/flags + image).
Text(String)
Raw(Vec<u8>)
Lob
Number(String)
BinaryInteger(String)
BinaryDouble(f64)
BinaryFloat(f64)
Boolean(bool)
IntervalDS
IntervalYM
DateTime
Timestamp
TimestampTz
Fields
Array
Vector(Vector)
Json(Vec<u8>)
Native Oracle JSON bind (DB_TYPE_JSON): the already-encoded OSON image.
The Python-facing layer encodes the value to OSON before binding so the
connection’s long-field-name capability can be applied.
Cursor
Implementations§
Source§impl BindValue
impl BindValue
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 bind’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 remains the single
exhaustiveness tripwire that flags a new variant at compile time.
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Whether this bind is a plain SQL NULL (BindValue::Null). The typed
NULL placeholder (BindValue::TypedNull) is not considered null by
this accessor — it carries a concrete Oracle type for the server.
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Borrow the string of a BindValue::Text bind, otherwise None.
Convenience accessor so callers can read text binds without matching the
full enum.
Sourcepub fn as_bytes(&self) -> Option<&[u8]>
pub fn as_bytes(&self) -> Option<&[u8]>
Borrow the bytes of a BindValue::Raw bind, otherwise None.
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Return the boolean of a BindValue::Boolean bind, otherwise None.
Sourcepub fn as_number_text(&self) -> Option<&str>
pub fn as_number_text(&self) -> Option<&str>
Borrow the canonical decimal text of a BindValue::Number or
BindValue::BinaryInteger bind (both carry their value as decimal
text), otherwise None.
Sourcepub fn as_f64(&self) -> Option<f64>
pub fn as_f64(&self) -> Option<f64>
Interpret this bind as an f64. Works for BindValue::BinaryDouble /
BindValue::BinaryFloat (carried as f64), and for the decimal-text
BindValue::Number / BindValue::BinaryInteger binds when the text
parses. Returns None for any other variant. Models the reference shim’s
own numeric read of a bound vector element (convert.rs).
Sourcepub fn as_i64(&self) -> Option<i64>
pub fn as_i64(&self) -> Option<i64>
Interpret this bind as an i64. Works for the decimal-text
BindValue::Number / BindValue::BinaryInteger binds when the text
parses as an integer, and for BindValue::Boolean (true -> 1,
false -> 0). Returns None otherwise.