Enum hdbconnect::HdbValue

source ·
pub enum HdbValue<'a> {
Show 24 variants NULL, TINYINT(u8), SMALLINT(i16), INT(i32), BIGINT(i64), DECIMAL(BigDecimal), REAL(f32), DOUBLE(f64), BINARY(Vec<u8>), SYNC_CLOB(CLob), SYNC_NCLOB(NCLob), SYNC_BLOB(BLob), SYNC_LOBSTREAM(Option<Arc<Mutex<dyn Read + Send>>>), BOOLEAN(bool), STRING(String), DBSTRING(Vec<u8>), STR(&'a str), LONGDATE(LongDate), SECONDDATE(SecondDate), DAYDATE(DayDate), SECONDTIME(SecondTime), GEOMETRY(Vec<u8>), POINT(Vec<u8>), ARRAY(Vec<HdbValue<'a>>),
}
Expand description

Enum for all supported database value types.

Variants§

§

NULL

Representation of a database NULL value.

§

TINYINT(u8)

Stores an 8-bit unsigned integer. The minimum value is 0. The maximum value is 255.

§

SMALLINT(i16)

Stores a 16-bit signed integer. The minimum value is -32,768. The maximum value is 32,767.

§

INT(i32)

Stores a 32-bit signed integer. The minimum value is -2,147,483,648. The maximum value is 2,147,483,647.

§

BIGINT(i64)

Stores a 64-bit signed integer. The minimum value is -9,223,372,036,854,775,808. The maximum value is 9,223,372,036,854,775,807.

§

DECIMAL(BigDecimal)

Representation for fixed-point decimal values.

§

REAL(f32)

Stores a single-precision 32-bit floating-point number.

§

DOUBLE(f64)

Stores a double-precision 64-bit floating-point number. The minimum value is -1.7976931348623157E308, the maximum value is 1.7976931348623157E308 . The smallest positive DOUBLE value is 2.2250738585072014E-308 and the largest negative DOUBLE value is -2.2250738585072014E-308.

§

BINARY(Vec<u8>)

Stores binary data.

§

SYNC_CLOB(CLob)

Stores a large ASCII character string.

§

SYNC_NCLOB(NCLob)

Stores a large Unicode string.

§

SYNC_BLOB(BLob)

Stores a large binary string.

§

SYNC_LOBSTREAM(Option<Arc<Mutex<dyn Read + Send>>>)

Used for streaming LOBs to the database (see PreparedStatement::execute_row()).

§

BOOLEAN(bool)

BOOLEAN stores boolean values, which are TRUE or FALSE.

§

STRING(String)

The DB returns all valid Strings as type STRING, independent of the concrete column type.

§

DBSTRING(Vec<u8>)

In rare cases, when the database sends invalid CESU-8, we fall back to this type.

§

STR(&'a str)

Can be used for avoiding cloning when sending large Strings to the database (see PreparedStatement::execute_row()).

§

LONGDATE(LongDate)

Timestamp with 10^-7 seconds precision, uses eight bytes.

§

SECONDDATE(SecondDate)

TIMESTAMP with second precision.

§

DAYDATE(DayDate)

DATE with day precision.

§

SECONDTIME(SecondTime)

TIME with second precision.

§

GEOMETRY(Vec<u8>)

Spatial type GEOMETRY.

§

POINT(Vec<u8>)

Spatial type POINT.

§

ARRAY(Vec<HdbValue<'a>>)

HANA’s array type

Implementations§

source§

impl<'a> HdbValue<'a>

source

pub fn is_null(&self) -> bool

Returns true if the value is a NULL value.

source§

impl HdbValue<'static>

source

pub fn try_into<'x, T>(self) -> Result<T, HdbError>
where T: Deserialize<'x>,

Deserialize into a rust type.

§Errors

HdbError::DeserializationError if the target type does not fit.

source

pub fn try_into_blob(self) -> Result<BLob, HdbError>

Convert into BLob.

§Errors

HdbError::UsageDetailed if this is not a HdbValue::BLOB.

source

pub fn try_into_clob(self) -> Result<CLob, HdbError>

Convert into CLob.

§Errors

HdbError::UsageDetailed if this is not a HdbValue::CLOB.

source

pub fn try_into_nclob(self) -> Result<NCLob, HdbError>

Convert into NCLob.

§Errors

HdbError::UsageDetailed if this is not a HdbValue::NCLOB.

Trait Implementations§

source§

impl DbValue for HdbValue<'static>

source§

fn is_null(&self) -> bool

Returns true if this is a NULL value.
§

fn try_into<'de, T>(self) -> Result<T, DeserializationError>
where T: Deserialize<'de>,

Converts the DbValue into a plain rust value. Read more
source§

impl DbValueInto<String> for HdbValue<'static>

source§

fn try_into(self) -> Result<String, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<Vec<u8>> for HdbValue<'static>

source§

fn try_into(self) -> Result<Vec<u8>, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<bool> for HdbValue<'static>

source§

fn try_into(self) -> Result<bool, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<f32> for HdbValue<'static>

source§

fn try_into(self) -> Result<f32, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<f64> for HdbValue<'static>

source§

fn try_into(self) -> Result<f64, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<i16> for HdbValue<'static>

source§

fn try_into(self) -> Result<i16, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<i32> for HdbValue<'static>

source§

fn try_into(self) -> Result<i32, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<i64> for HdbValue<'static>

source§

fn try_into(self) -> Result<i64, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<i8> for HdbValue<'static>

source§

fn try_into(self) -> Result<i8, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<u16> for HdbValue<'static>

source§

fn try_into(self) -> Result<u16, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<u32> for HdbValue<'static>

source§

fn try_into(self) -> Result<u32, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<u64> for HdbValue<'static>

source§

fn try_into(self) -> Result<u64, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl DbValueInto<u8> for HdbValue<'static>

source§

fn try_into(self) -> Result<u8, ConversionError>

Converts the database value into the target rust type. Read more
source§

impl<'a> Debug for HdbValue<'a>

source§

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

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

impl<'a> Display for HdbValue<'a>

source§

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

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

impl<'a> PartialEq<&str> for HdbValue<'a>

source§

fn eq(&self, rhs: &&str) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<i32> for HdbValue<'a>

source§

fn eq(&self, rhs: &i32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for HdbValue<'a>

§

impl<'a> Send for HdbValue<'a>

§

impl<'a> Sync for HdbValue<'a>

§

impl<'a> Unpin for HdbValue<'a>

§

impl<'a> UnwindSafe for HdbValue<'a>

Blanket Implementations§

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

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V