Skip to main content

ColumnInfo

Struct ColumnInfo 

Source
pub struct ColumnInfo {
    pub name: String,
    pub data_type: DataType,
    pub nullable: bool,
    pub position: usize,
    pub table_name: Option<String>,
    pub cql_type: Option<CqlType>,
}
Expand description

Information about a column in the result set

Fields§

§name: String

Column name

§data_type: DataType

Column data type (flat, kept for backward compatibility)

§nullable: bool

Whether column can be null

§position: usize

Column position in result set

§table_name: Option<String>

Original table name (for joined queries)

§cql_type: Option<CqlType>

Full schema-sourced CQL type (populated when a schema is available).

This field expresses element types for collections (list<int>, map<text, bigint>), and carries variants absent from the flat DataType enum (date, time, decimal, varint, counter, duration, inet). Downstream writers MUST use this over data_type when it is Some — the no-heuristics mandate (Issue #28) requires authoritative-schema metadata rather than runtime inference.

Implementations§

Source§

impl ColumnInfo

Source

pub fn new( name: String, data_type: DataType, nullable: bool, position: usize, ) -> Self

Create new column info

Source

pub fn with_table_name(self, table_name: String) -> Self

Set table name

Source

pub fn with_cql_type(self, cql_type: CqlType) -> Self

Attach a schema-sourced CqlType to this column.

The data_type field is left unchanged so existing consumers remain unaffected; downstream writers that need full type fidelity (e.g. the Parquet/Arrow writer) should prefer cql_type when it is Some.

Source

pub fn to_json(&self) -> Value

Convert to JSON representation

The data_type and all pre-existing keys are preserved unchanged for backward compatibility. The new cql_type key is only emitted when the field is Some (it is marked skip_serializing_if in the struct derive, but we also reflect it here for the hand-rolled JSON path).

Trait Implementations§

Source§

impl Clone for ColumnInfo

Source§

fn clone(&self) -> ColumnInfo

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 ColumnInfo

Source§

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

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

impl<'de> Deserialize<'de> for ColumnInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ColumnInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.