pub enum TextValue {
Null,
Text(String),
}Expand description
A single column’s text-format value as received from the backend.
Held as a Cow<str> view into the row bytes; callers typically turn
it into a typed Rust value via the as_<type> helpers below.
Variants§
Implementations§
Source§impl TextValue
impl TextValue
Sourcepub fn into_string(self) -> Option<String>
pub fn into_string(self) -> Option<String>
Consume and return the inner String, or None for NULL.
Sourcepub fn as_bool(&self, column: &str) -> BackendResult<Option<bool>>
pub fn as_bool(&self, column: &str) -> BackendResult<Option<bool>>
Decode as bool. PostgreSQL text format is "t" or "f".
Sourcepub fn as_i64(&self, column: &str) -> BackendResult<Option<i64>>
pub fn as_i64(&self, column: &str) -> BackendResult<Option<i64>>
Decode as i64 (covers INT4 and INT8 at the wire level — text
format is the same).
Sourcepub fn as_f64(&self, column: &str) -> BackendResult<Option<f64>>
pub fn as_f64(&self, column: &str) -> BackendResult<Option<f64>>
Decode as f64 (FLOAT8 / double precision).
Sourcepub fn as_timestamptz(
&self,
column: &str,
) -> BackendResult<Option<DateTime<FixedOffset>>>
pub fn as_timestamptz( &self, column: &str, ) -> BackendResult<Option<DateTime<FixedOffset>>>
Decode as DateTime<FixedOffset> (TIMESTAMPTZ). PG text format
with a timezone offset: 2026-04-24 12:34:56.789+00.
Sourcepub fn as_pg_lsn(&self, column: &str) -> BackendResult<Option<String>>
pub fn as_pg_lsn(&self, column: &str) -> BackendResult<Option<String>>
Decode as a textual pg_lsn (e.g. "0/16B3758"). We leave LSN
arithmetic to callers — string form is what pg_last_wal_*_lsn()
returns in text format, and the natural lex order on these
strings matches WAL ordering for positions in the same
timeline.
Sourcepub fn as_numeric(&self, column: &str) -> BackendResult<Option<String>>
pub fn as_numeric(&self, column: &str) -> BackendResult<Option<String>>
Decode as NUMERIC — text is PG’s canonical form (e.g. “3.1415”).
We return the raw string; callers that need arithmetic can route
to rust_decimal or parse further.
Trait Implementations§
impl StructuralPartialEq for TextValue
Auto Trait Implementations§
impl Freeze for TextValue
impl RefUnwindSafe for TextValue
impl Send for TextValue
impl Sync for TextValue
impl Unpin for TextValue
impl UnsafeUnpin for TextValue
impl UnwindSafe for TextValue
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<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> 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