pub trait ToType {
// Required method
fn to_type() -> Type;
}Expand description
Trait for mapping Rust primitive types to ClickHouse types
Equivalent to C++ Type::CreateSimple<T>() template specializations
This trait allows type inference in column constructors, eliminating the need to pass Type explicitly when creating typed columns.
§Examples
use clickhouse_native_client::types::{Type, ToType};
assert_eq!(i32::to_type(), Type::int32());
assert_eq!(u64::to_type(), Type::uint64());
assert_eq!(f64::to_type(), Type::float64());Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.