pub enum ParamFormat {
Text,
Binary,
}Expand description
Wire format for a bound parameter in the Bind message.
Distinct from ColumnFormat, which describes result columns and
carries a third HyperBinary variant. Parameters only ever travel as
PostgreSQL text or PostgreSQL binary — Hyper has no HyperBinary input
decoder for bound parameters.
Binary is the default and the fast path. Text exists because Hyper has no PG-binary input function for a couple of types:
- scaled
NUMERIC— a binary NUMERIC whosedscaleexceeds the parameter’s resolved scale is rejected with SQLSTATE0A000(“cannot handle truncation when reading numerics”). geography— rejected with42883, “no pg binary input function available for type geography”.
The Bind message carries a per-parameter format-code array, so a
single statement can mix both.
Variants§
Text
PostgreSQL text format (format code 0) — the value’s SQL literal
representation, sent as UTF-8 without surrounding quotes.
Binary
Standard PostgreSQL binary format (format code 1, big-endian).
Implementations§
Source§impl ParamFormat
impl ParamFormat
Sourcepub const BINARY_CODE: i16 = 1
pub const BINARY_CODE: i16 = 1
Wire format code for ParamFormat::Binary.
Sourcepub const TEXT_CODE: i16 = 0
pub const TEXT_CODE: i16 = 0
Wire format code for ParamFormat::Text.
Trait Implementations§
Source§impl Clone for ParamFormat
impl Clone for ParamFormat
Source§fn clone(&self) -> ParamFormat
fn clone(&self) -> ParamFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ParamFormat
Source§impl Debug for ParamFormat
impl Debug for ParamFormat
Source§impl Default for ParamFormat
impl Default for ParamFormat
Source§fn default() -> ParamFormat
fn default() -> ParamFormat
impl Eq for ParamFormat
Source§impl PartialEq for ParamFormat
impl PartialEq for ParamFormat
impl StructuralPartialEq for ParamFormat
Auto Trait Implementations§
impl Freeze for ParamFormat
impl RefUnwindSafe for ParamFormat
impl Send for ParamFormat
impl Sync for ParamFormat
impl Unpin for ParamFormat
impl UnsafeUnpin for ParamFormat
impl UnwindSafe for ParamFormat
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request