Skip to main content

BindValue

Enum BindValue 

Source
#[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
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.
§

Null

§

TypedNull

Fields

§ora_type_num: u8
§csfrm: u8
§buffer_size: u32
§

Output

Fields

§ora_type_num: u8
§csfrm: u8
§buffer_size: u32
§

ReturnOutput

Fields

§ora_type_num: u8
§csfrm: u8
§buffer_size: u32
§

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.

Fields

§out_buffer_size: u32
§

ObjectOutput

Fields

§schema: String
§type_name: String
§oid: Vec<u8>
§version: u32
§buffer_size: u32
§is_return: bool
§

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).

Fields

§schema: String
§type_name: String
§oid: Vec<u8>
§version: u32
§image: Vec<u8>
§buffer_size: u32
§

Text(String)

§

Raw(Vec<u8>)

§

Lob

Fields

§ora_type_num: u8
§csfrm: u8
§locator: Vec<u8>
§

Number(String)

§

BinaryInteger(String)

§

BinaryDouble(f64)

§

BinaryFloat(f64)

§

Boolean(bool)

§

IntervalDS

Fields

§days: i32
§seconds: i32
§microseconds: i32
§

IntervalYM

Fields

§years: i32
§months: i32
§

DateTime

Fields

§year: i32
§month: u8
§day: u8
§hour: u8
§minute: u8
§second: u8
§

Timestamp

Fields

§ora_type_num: u8
§year: i32
§month: u8
§day: u8
§hour: u8
§minute: u8
§second: u8
§nanosecond: u32
§

TimestampTz

Fields

§year: i32
§month: u8
§day: u8
§hour: u8
§minute: u8
§second: u8
§nanosecond: u32
§offset_minutes: i32
§

Array

Fields

§ora_type_num: u8
§csfrm: u8
§buffer_size: u32
§max_elements: u32
§

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

Fields

§cursor_id: u32

Implementations§

Source§

impl BindValue

Source

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.

Source

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.

Source

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.

Source

pub fn as_bytes(&self) -> Option<&[u8]>

Borrow the bytes of a BindValue::Raw bind, otherwise None.

Source

pub fn as_bool(&self) -> Option<bool>

Return the boolean of a BindValue::Boolean bind, otherwise None.

Source

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.

Source

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).

Source

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.

Trait Implementations§

Source§

impl Clone for BindValue

Source§

fn clone(&self) -> BindValue

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BindValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for BindValue

Source§

fn eq(&self, other: &BindValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for BindValue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V