pub enum OwnedPostgresValue {
Smallint(i16),
Integer(i32),
Bigint(i64),
Real(f32),
DoublePrecision(f64),
Text(String),
Bytea(Vec<u8>),
Boolean(bool),
Array(Vec<OwnedPostgresValue>),
Null,
}Expand description
Owned version of PostgresValue that doesn’t borrow data
Variants§
Smallint(i16)
SMALLINT values (16-bit signed integer)
Integer(i32)
INTEGER values (32-bit signed integer)
Bigint(i64)
BIGINT values (64-bit signed integer)
Real(f32)
REAL values (32-bit floating point)
DoublePrecision(f64)
DOUBLE PRECISION values (64-bit floating point)
Text(String)
TEXT, VARCHAR, CHAR values (owned)
Bytea(Vec<u8>)
BYTEA values (owned binary data)
Boolean(bool)
BOOLEAN values
Array(Vec<OwnedPostgresValue>)
Array of any PostgreSQL type
Null
NULL value
Implementations§
Source§impl OwnedPostgresValue
impl OwnedPostgresValue
Sourcepub fn as_array(&self) -> Option<&[OwnedPostgresValue]>
pub fn as_array(&self) -> Option<&[OwnedPostgresValue]>
Returns the array elements if this is an ARRAY.
Sourcepub fn as_value(&self) -> PostgresValue<'_>
pub fn as_value(&self) -> PostgresValue<'_>
Returns a borrowed PostgresValue view of this owned value.
Sourcepub fn convert<T: FromPostgresValue>(self) -> Result<T, DrizzleError>
pub fn convert<T: FromPostgresValue>(self) -> Result<T, DrizzleError>
Convert this PostgreSQL value to a Rust type using the FromPostgresValue trait.
Sourcepub fn convert_ref<T: FromPostgresValue>(&self) -> Result<T, DrizzleError>
pub fn convert_ref<T: FromPostgresValue>(&self) -> Result<T, DrizzleError>
Convert a reference to this PostgreSQL value to a Rust type.
Trait Implementations§
Source§impl Clone for OwnedPostgresValue
impl Clone for OwnedPostgresValue
Source§fn clone(&self) -> OwnedPostgresValue
fn clone(&self) -> OwnedPostgresValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OwnedPostgresValue
impl Debug for OwnedPostgresValue
Source§impl Default for OwnedPostgresValue
impl Default for OwnedPostgresValue
Source§fn default() -> OwnedPostgresValue
fn default() -> OwnedPostgresValue
Returns the “default value” for a type. Read more
Source§impl Display for OwnedPostgresValue
impl Display for OwnedPostgresValue
Source§impl<'a> From<&'a OwnedPostgresValue> for Cow<'a, OwnedPostgresValue>
impl<'a> From<&'a OwnedPostgresValue> for Cow<'a, OwnedPostgresValue>
Source§fn from(value: &'a OwnedPostgresValue) -> Self
fn from(value: &'a OwnedPostgresValue) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a OwnedPostgresValue> for PostgresValue<'a>
impl<'a> From<&'a OwnedPostgresValue> for PostgresValue<'a>
Source§fn from(value: &'a OwnedPostgresValue) -> Self
fn from(value: &'a OwnedPostgresValue) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&PostgresValue<'a>> for OwnedPostgresValue
impl<'a> From<&PostgresValue<'a>> for OwnedPostgresValue
Source§fn from(value: &PostgresValue<'a>) -> Self
fn from(value: &PostgresValue<'a>) -> Self
Converts to this type from the input type.
Source§impl From<OwnedPostgresValue> for Cow<'_, OwnedPostgresValue>
impl From<OwnedPostgresValue> for Cow<'_, OwnedPostgresValue>
Source§fn from(value: OwnedPostgresValue) -> Self
fn from(value: OwnedPostgresValue) -> Self
Converts to this type from the input type.
Source§impl<'a> From<OwnedPostgresValue> for PostgresValue<'a>
impl<'a> From<OwnedPostgresValue> for PostgresValue<'a>
Source§fn from(value: OwnedPostgresValue) -> Self
fn from(value: OwnedPostgresValue) -> Self
Converts to this type from the input type.
Source§impl<'a> From<OwnedPostgresValue> for SQL<'a, OwnedPostgresValue>
impl<'a> From<OwnedPostgresValue> for SQL<'a, OwnedPostgresValue>
Source§fn from(value: OwnedPostgresValue) -> Self
fn from(value: OwnedPostgresValue) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PostgresValue<'a>> for OwnedPostgresValue
impl<'a> From<PostgresValue<'a>> for OwnedPostgresValue
Source§fn from(value: PostgresValue<'a>) -> Self
fn from(value: PostgresValue<'a>) -> Self
Converts to this type from the input type.
Source§impl From<String> for OwnedPostgresValue
impl From<String> for OwnedPostgresValue
Source§impl From<bool> for OwnedPostgresValue
impl From<bool> for OwnedPostgresValue
Source§impl From<f32> for OwnedPostgresValue
impl From<f32> for OwnedPostgresValue
Source§impl From<f64> for OwnedPostgresValue
impl From<f64> for OwnedPostgresValue
Source§impl From<i16> for OwnedPostgresValue
impl From<i16> for OwnedPostgresValue
Source§impl From<i32> for OwnedPostgresValue
impl From<i32> for OwnedPostgresValue
Source§impl From<i64> for OwnedPostgresValue
impl From<i64> for OwnedPostgresValue
Source§impl PartialEq for OwnedPostgresValue
impl PartialEq for OwnedPostgresValue
Source§impl SQLParam for OwnedPostgresValue
impl SQLParam for OwnedPostgresValue
Source§impl TryFrom<OwnedPostgresValue> for String
impl TryFrom<OwnedPostgresValue> for String
Source§type Error = DrizzleError
type Error = DrizzleError
The type returned in the event of a conversion error.
Source§impl TryFrom<OwnedPostgresValue> for Vec<u8>
impl TryFrom<OwnedPostgresValue> for Vec<u8>
Source§type Error = DrizzleError
type Error = DrizzleError
The type returned in the event of a conversion error.
Source§impl TryFrom<OwnedPostgresValue> for bool
impl TryFrom<OwnedPostgresValue> for bool
Source§type Error = DrizzleError
type Error = DrizzleError
The type returned in the event of a conversion error.
Source§impl TryFrom<OwnedPostgresValue> for f32
impl TryFrom<OwnedPostgresValue> for f32
Source§type Error = DrizzleError
type Error = DrizzleError
The type returned in the event of a conversion error.
Source§impl TryFrom<OwnedPostgresValue> for f64
impl TryFrom<OwnedPostgresValue> for f64
Source§type Error = DrizzleError
type Error = DrizzleError
The type returned in the event of a conversion error.
Source§impl TryFrom<OwnedPostgresValue> for i16
impl TryFrom<OwnedPostgresValue> for i16
Source§type Error = DrizzleError
type Error = DrizzleError
The type returned in the event of a conversion error.
Source§impl TryFrom<OwnedPostgresValue> for i32
impl TryFrom<OwnedPostgresValue> for i32
Source§type Error = DrizzleError
type Error = DrizzleError
The type returned in the event of a conversion error.
Source§impl TryFrom<OwnedPostgresValue> for i64
impl TryFrom<OwnedPostgresValue> for i64
Source§type Error = DrizzleError
type Error = DrizzleError
The type returned in the event of a conversion error.
impl StructuralPartialEq for OwnedPostgresValue
Auto Trait Implementations§
impl Freeze for OwnedPostgresValue
impl RefUnwindSafe for OwnedPostgresValue
impl Send for OwnedPostgresValue
impl Sync for OwnedPostgresValue
impl Unpin for OwnedPostgresValue
impl UnwindSafe for OwnedPostgresValue
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more