pub struct TypeRef<'a> { /* private fields */ }Expand description
Borrowed view of a ClickHouse type.
Implementations§
Source§impl<'a> TypeRef<'a>
impl<'a> TypeRef<'a>
pub fn kind(&self) -> Option<Kind>
Sourcepub fn n_children(&self) -> usize
pub fn n_children(&self) -> usize
Returns number of child types.
Child types include array elements, tuple and nested fields, map keys
and values, aggregate function argument types, and inner types of
Nullable and LowCardinality.
pub fn child(&self, i: usize) -> Option<TypeRef<'a>>
Sourcepub fn fixed_size(&self) -> i32
pub fn fixed_size(&self) -> i32
Returns N for FixedString(N), or zero for other types.
Sourcepub fn elem_size(&self) -> usize
pub fn elem_size(&self) -> usize
Returns byte width in a Fixed column.
Returns zero for types without fixed-width storage.
Sourcepub fn decimal_precision(&self) -> i32
pub fn decimal_precision(&self) -> i32
Returns P for Decimal(P, S), or zero for other types.
Sourcepub fn decimal_scale(&self) -> i32
pub fn decimal_scale(&self) -> i32
Returns S for Decimal(P, S), or zero for other types.
Sourcepub fn datetime64_scale(&self) -> i32
pub fn datetime64_scale(&self) -> i32
Returns subsecond precision for DateTime64(S) or Time64(S).
Returns zero for other types.
Sourcepub fn interval_unit(&self) -> Option<IntervalUnit>
pub fn interval_unit(&self) -> Option<IntervalUnit>
Returns unit for an Interval* type, or None for other types.
Sourcepub fn qbit_dimension(&self) -> usize
pub fn qbit_dimension(&self) -> usize
Returns N for QBit(T, N), or zero for other types.
A QBit column uses ColumnLayout::Tuple with one fixed column per
bit in T. Columns use most significant bit first, and each row holds
ceil(N / 8) bytes.
Sourcepub fn qbit_element_size(&self) -> usize
pub fn qbit_element_size(&self) -> usize
Returns bit width of T in QBit(T, N), or zero for other types.
Supported widths are 16, 32, and 64.
Sourcepub fn enum_count(&self) -> usize
pub fn enum_count(&self) -> usize
Returns number of entries for Enum8 or Enum16.
Returns zero for other types.
Sourcepub fn enum_at(&self, i: usize) -> Option<(&'a [u8], i64)>
pub fn enum_at(&self, i: usize) -> Option<(&'a [u8], i64)>
Returns name and value for enum entry at i.
Name bytes are not validated as UTF-8.
Sourcepub fn tuple_field_name(&self, i: usize) -> Option<&'a [u8]>
pub fn tuple_field_name(&self, i: usize) -> Option<&'a [u8]>
Returns Tuple or Nested field name bytes without UTF-8 validation.
Sourcepub fn agg_function(&self) -> Option<&'a [u8]>
pub fn agg_function(&self) -> Option<&'a [u8]>
Returns function name of AggregateFunction or
SimpleAggregateFunction without UTF-8 validation.
Function parameters are not part of name. Children hold argument types, first of which carries stored values.