pub enum ColumnFormat {
Text,
Binary,
HyperBinary,
}Expand description
Format code for column data.
This indicates how data values are encoded in the wire protocol. The format affects how values are serialized/deserialized and can significantly impact performance.
Variants§
Text
Text format (human-readable ASCII).
Values are sent as UTF-8 strings. Slower but human-readable. Use for debugging or when compatibility with text-based tools is needed.
Binary
Standard PostgreSQL binary format.
Uses PostgreSQL’s standard binary encoding (BigEndian for most types).
Compatible with standard PostgreSQL clients.
HyperBinary
Hyper-specific binary format (little-endian, optimized).
Uses Hyper’s optimized binary format where all multi-byte values are
little-endian (x86/ARM-LE native byte order), avoiding byte-swapping
on modern hardware. This contrasts with standard PostgreSQL binary format
which uses big-endian (network byte order).
Additional differences from PostgreSQL binary:
- No per-row field count prefix (rows are implicitly framed)
- NULL is a 1-byte indicator on nullable columns only (vs 4-byte
-1length) - Fixed-size types have no length prefix (vs 4-byte length in PG binary)
This is the fastest format and is used by default for query_fast(),
query_streaming(), and the COPY bulk insertion path.
Implementations§
Trait Implementations§
Source§impl Clone for ColumnFormat
impl Clone for ColumnFormat
Source§fn clone(&self) -> ColumnFormat
fn clone(&self) -> ColumnFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ColumnFormat
impl Debug for ColumnFormat
Source§impl Default for ColumnFormat
impl Default for ColumnFormat
Source§fn default() -> ColumnFormat
fn default() -> ColumnFormat
Source§impl PartialEq for ColumnFormat
impl PartialEq for ColumnFormat
Source§fn eq(&self, other: &ColumnFormat) -> bool
fn eq(&self, other: &ColumnFormat) -> bool
self and other values to be equal, and is used by ==.impl Copy for ColumnFormat
impl Eq for ColumnFormat
impl StructuralPartialEq for ColumnFormat
Auto Trait Implementations§
impl Freeze for ColumnFormat
impl RefUnwindSafe for ColumnFormat
impl Send for ColumnFormat
impl Sync for ColumnFormat
impl Unpin for ColumnFormat
impl UnsafeUnpin for ColumnFormat
impl UnwindSafe for ColumnFormat
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