Skip to main content

Bind

Enum Bind 

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

Fields

§scale: i8
§

NullDecimal128

Typed NULL for DECIMAL128.

Fields

§scale: i8
§

NullDecimal256

Typed NULL for DECIMAL256.

Fields

§scale: i8
§

NullGeohash

Typed NULL for GEOHASH (precision must be on the wire).

Fields

§precision_bits: u8
§

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.

Fields

§value: i64
§scale: i8
§

Decimal128

QWP DECIMAL128: i128 mantissa + scale.

Fields

§value: i128
§scale: i8
§

Decimal256

QWP DECIMAL256: 32-byte LE mantissa + scale.

Fields

§bytes: [u8; 32]
§scale: i8
§

Geohash

QWP GEOHASH: zero-extended u64 + precision_bits (1..=60). The least-significant ceil(precision_bits/8) bytes are written.

Fields

§value: u64
§precision_bits: u8

Implementations§

Source§

impl Bind

Source

pub fn kind(&self) -> ColumnKind

QWP type code this bind serializes to.

Trait Implementations§

Source§

impl Clone for Bind

Source§

fn clone(&self) -> Bind

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 Bind

Source§

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

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

impl PartialEq for Bind

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

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§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

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

Source§

fn align() -> usize

The alignment necessary for the key. Must return a power of two.
Source§

fn size(&self) -> usize

The size of the key in bytes.
Source§

unsafe fn init(&self, ptr: *mut u8)

Initialize the key in the given memory location. Read more
Source§

unsafe fn get<'a>(ptr: *const u8) -> &'a T

Get a reference to the key from the given memory location. Read more
Source§

unsafe fn drop_in_place(ptr: *mut u8)

Drop the key in place. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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