Skip to main content

TypeRef

Struct TypeRef 

Source
pub struct TypeRef<'a> { /* private fields */ }
Expand description

Borrowed view of a ClickHouse type.

Implementations§

Source§

impl<'a> TypeRef<'a>

Source

pub fn kind(&self) -> Option<Kind>

Source

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.

Source

pub fn child(&self, i: usize) -> Option<TypeRef<'a>>

Source

pub fn fixed_size(&self) -> i32

Returns N for FixedString(N), or zero for other types.

Source

pub fn elem_size(&self) -> usize

Returns byte width in a Fixed column. Returns zero for types without fixed-width storage.

Source

pub fn decimal_precision(&self) -> i32

Returns P for Decimal(P, S), or zero for other types.

Source

pub fn decimal_scale(&self) -> i32

Returns S for Decimal(P, S), or zero for other types.

Source

pub fn datetime64_scale(&self) -> i32

Returns subsecond precision for DateTime64(S) or Time64(S). Returns zero for other types.

Source

pub fn interval_unit(&self) -> Option<IntervalUnit>

Returns unit for an Interval* type, or None for other types.

Source

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.

Source

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.

Source

pub fn timezone(&self) -> Option<&'a [u8]>

Returns timezone bytes without UTF-8 validation.

Source

pub fn name(&self) -> Option<&'a [u8]>

Returns type name bytes without UTF-8 validation.

Source

pub fn enum_count(&self) -> usize

Returns number of entries for Enum8 or Enum16. Returns zero for other types.

Source

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.

Source

pub fn tuple_field_name(&self, i: usize) -> Option<&'a [u8]>

Returns Tuple or Nested field name bytes without UTF-8 validation.

Source

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.

Source

pub fn format(&self) -> String

Formats type as a ClickHouse type name.

Trait Implementations§

Source§

impl<'a> Clone for TypeRef<'a>

Source§

fn clone(&self) -> Self

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<'a> Copy for TypeRef<'a>

Auto Trait Implementations§

§

impl<'a> !Send for TypeRef<'a>

§

impl<'a> !Sync for TypeRef<'a>

§

impl<'a> Freeze for TypeRef<'a>

§

impl<'a> RefUnwindSafe for TypeRef<'a>

§

impl<'a> Unpin for TypeRef<'a>

§

impl<'a> UnsafeUnpin for TypeRef<'a>

§

impl<'a> UnwindSafe for TypeRef<'a>

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

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.