#[non_exhaustive]pub enum Bind {
Show 27 variants
Null(SimpleNullKind),
NullVarchar,
NullBinary,
NullDecimal64 {
scale: i8,
},
NullDecimal128 {
scale: i8,
},
NullDecimal256 {
scale: i8,
},
NullGeohash {
precision_bits: u8,
},
Bool(bool),
I8(i8),
I16(i16),
I32(i32),
I64(i64),
F32(f32),
F64(f64),
Varchar(String),
Binary(Vec<u8>),
TimestampMicros(i64),
TimestampNanos(i64),
DateMillis(i64),
Uuid([u8; 16]),
Long256([u8; 32]),
Char(u16),
Ipv4(Ipv4Addr),
Decimal64 {
value: i64,
scale: i8,
},
Decimal128 {
value: i128,
scale: i8,
},
Decimal256 {
bytes: [u8; 32],
scale: i8,
},
Geohash {
value: u64,
precision_bits: u8,
},
}Expand description
Typed bind value.
Position is implicit in the order binds are emitted into a QUERY_REQUEST
($1, $2, …). Types whose null wire encoding carries column-level
metadata have dedicated Null* variants; everything else uses
Bind::Null.
#[non_exhaustive] so future bind types (e.g. when the server
lifts the array-bind restriction documented in the PHASE 1 SERVER COMPATIBILITY block at module top) can be added without breaking
exhaustive matches in user code.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Null(SimpleNullKind)
Typed NULL for any simple-null kind. The SimpleNullKind type
statically excludes kinds (VARCHAR / BINARY / DECIMAL* / GEOHASH)
whose null wire encoding requires column-level metadata, so an
invalid Bind::Null is unrepresentable.
NullVarchar
Typed NULL for VARCHAR (offsets array length-1 even with no values).
NullBinary
Typed NULL for BINARY (same offsets-array reason).
NullDecimal64
Typed NULL for DECIMAL64 (scale must be on the wire).
NullDecimal128
Typed NULL for DECIMAL128.
NullDecimal256
Typed NULL for DECIMAL256.
NullGeohash
Typed NULL for GEOHASH (precision must be on the wire).
Bool(bool)
I8(i8)
Maps to QWP BYTE (signed 8-bit).
I16(i16)
Maps to QWP SHORT (signed 16-bit).
I32(i32)
Maps to QWP INT (signed 32-bit).
I64(i64)
Maps to QWP LONG (signed 64-bit).
F32(f32)
F64(f64)
Varchar(String)
Binary(Vec<u8>)
TimestampMicros(i64)
QWP TIMESTAMP (microseconds since epoch).
TimestampNanos(i64)
QWP TIMESTAMP_NANOS (nanoseconds since epoch).
DateMillis(i64)
QWP DATE (milliseconds since epoch).
Uuid([u8; 16])
16 raw bytes; high/low long ordering is the caller’s responsibility.
Long256([u8; 32])
32 raw bytes; LONG256 is opaque on the wire.
Char(u16)
2-byte UTF-16 code unit (CHAR).
Ipv4(Ipv4Addr)
Decimal64
QWP DECIMAL64: i64 mantissa + scale.
Decimal128
QWP DECIMAL128: i128 mantissa + scale.
Decimal256
QWP DECIMAL256: 32-byte LE mantissa + scale.
Geohash
QWP GEOHASH: zero-extended u64 + precision_bits (1..=60). The
least-significant ceil(precision_bits/8) bytes are written.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Bind
Auto Trait Implementations§
impl Freeze for Bind
impl RefUnwindSafe for Bind
impl Send for Bind
impl Sync for Bind
impl Unpin for Bind
impl UnsafeUnpin for Bind
impl UnwindSafe for Bind
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more