#[non_exhaustive]pub enum IgniteValue {
Show 23 variants
Null,
Bool(bool),
Byte(i8),
Short(i16),
Int(i32),
Long(i64),
Float(f32),
Double(f64),
Char(u16),
String(String),
Uuid(Uuid),
Date(i64),
Timestamp(i64, i32),
Time(i64),
Decimal(BigDecimal),
ByteArray(Vec<u8>),
RawObject(Vec<u8>),
Object(BinaryObject),
IntArray(Vec<i32>),
StringArray(Vec<Option<String>>),
Collection(u8, Vec<IgniteValue>),
Map(u8, Vec<(IgniteValue, IgniteValue)>),
Enum {
type_id: i32,
ordinal: i32,
},
}Expand description
Rust representation of a typed Ignite binary value.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Null
SQL NULL — absence of a value for any type.
Bool(bool)
SQL BOOLEAN.
Byte(i8)
Signed 8-bit integer (TINYINT).
Short(i16)
Signed 16-bit integer (SMALLINT).
Int(i32)
Signed 32-bit integer (INT).
Long(i64)
Signed 64-bit integer (BIGINT).
Float(f32)
Single-precision IEEE 754 float (REAL / FLOAT).
Double(f64)
Double-precision IEEE 754 float (DOUBLE).
Char(u16)
Unicode code point in the Basic Multilingual Plane (CHAR).
String(String)
UTF-8 string (VARCHAR / LONGVARCHAR).
Uuid(Uuid)
128-bit universally unique identifier (UUID / CHAR(36)).
Date(i64)
Milliseconds from the Unix epoch (DATE).
Timestamp(i64, i32)
(milliseconds_from_epoch, nanosecond_fraction) (TIMESTAMP).
Time(i64)
Nanoseconds from midnight (TIME).
Decimal(BigDecimal)
Arbitrary-precision decimal number (DECIMAL / NUMERIC).
ByteArray(Vec<u8>)
Raw byte array (BINARY / VARBINARY).
RawObject(Vec<u8>)
Payload bytes of an Ignite BINARY_OBJECT (type code 27), without the
outer type-code wrapper. When encoded, the codec writes the full
[u8: 27][i32: len][bytes][i32: offset=0] frame automatically.
When decoded, only the inner payload bytes (between the length prefix and
the trailing offset) are stored here.
Object(BinaryObject)
A fully-encoded nested binary (complex) object. Encoding writes its
frame bytes verbatim (the frame already begins with the COMPLEX_OBJECT
(103) type code). Decoded both for a top-level CACHE_GET binary
object and for a COMPLEX_OBJECT nested inside another one’s field
data (see the COMPLEX_OBJECT arm in codec::decode_value_with_code);
see crate::binary for the ergonomic derive-based layer built on
top of this variant.
IntArray(Vec<i32>)
Signed 32-bit integer array (INT_ARRAY).
StringArray(Vec<Option<String>>)
Nullable UTF-8 string array (STRING_ARRAY); each element is None for
a null entry.
Collection(u8, Vec<IgniteValue>)
A Java collection (ARR_LIST = 2, LINKED_LIST = 3 in some Ignite
versions, HASH_SET = 3, USER_COL = 0, etc. — the raw collection-type
byte is preserved as-is) of type-coded elements.
Map(u8, Vec<(IgniteValue, IgniteValue)>)
A Java map (HASH_MAP = 1, LINKED_HASH_MAP = 2, etc. — the raw
map-type byte is preserved as-is) of type-coded key/value pairs.
Enum
A Java enum constant: the binary type id of the enum type and the ordinal of the constant.
Implementations§
Source§impl IgniteValue
impl IgniteValue
Sourcepub fn column_type(&self) -> ColumnType
pub fn column_type(&self) -> ColumnType
Returns the ColumnType for this value, derived directly from its
1-byte wire type-tag.
This is the reliable way to determine a column’s SQL type: because
OP_QUERY_SQL_FIELDS embeds a type code with every encoded value, the
type is always determinable at the value level regardless of schema
metadata. The only case that returns ColumnType::Unknown is
IgniteValue::Null, which carries no type information by definition.
Trait Implementations§
Source§impl Clone for IgniteValue
impl Clone for IgniteValue
Source§fn clone(&self) -> IgniteValue
fn clone(&self) -> IgniteValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more