Skip to main content

IgniteValue

Enum IgniteValue 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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.

Fields

§type_id: i32
§ordinal: i32

Implementations§

Source§

impl IgniteValue

Source

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

Source§

fn clone(&self) -> IgniteValue

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IgniteValue

Source§

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

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

impl From<&IgniteValue> for ColumnType

Source§

fn from(v: &IgniteValue) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for IgniteValue

Source§

fn eq(&self, other: &IgniteValue) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for IgniteValue

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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

Source§

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more