pub struct DataType {
pub type_name: i32,
pub precision: u32,
pub scale: u32,
pub is_nullable: bool,
pub interval_type: i32,
pub field_type: Vec<DataType>,
pub field_names: Vec<String>,
pub field_ids: Vec<i32>,
}
Fields§
§type_name: i32
§precision: u32
Data length for char. Max data length for varchar. Precision for time, decimal.
scale: u32
Scale for decimal.
is_nullable: bool
§interval_type: i32
§field_type: Vec<DataType>
For struct type, it represents all the fields in the struct.
For list type it only contains 1 element which is the inner item type of the List.
For example, ARRAY<INTEGER>
will be represented as vec!\[DataType::Int32\]
.
field_names: Vec<String>
Name of the fields if it is a struct type. For other types it will be empty.
field_ids: Vec<i32>
Id of the fields if it is a struct type. Used in serialization for nested-schema evolution purposes.
Empty if either:
- it is not a struct type
- it is not within a table schema (
ColumnDesc
) - it was persisted in an old version.
Implementations§
Source§impl DataType
impl DataType
Sourcepub fn type_name(&self) -> TypeName
pub fn type_name(&self) -> TypeName
Returns the enum value of type_name
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_type_name(&mut self, value: TypeName)
pub fn set_type_name(&mut self, value: TypeName)
Sets type_name
to the provided enum value.
Sourcepub fn interval_type(&self) -> IntervalType
pub fn interval_type(&self) -> IntervalType
Returns the enum value of interval_type
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_interval_type(&mut self, value: IntervalType)
pub fn set_interval_type(&mut self, value: IntervalType)
Sets interval_type
to the provided enum value.
Source§impl DataType
impl DataType
pub fn get_type_name(&self) -> Result<TypeName, PbFieldNotFound>
pub fn get_precision(&self) -> u32
pub fn get_scale(&self) -> u32
pub fn get_is_nullable(&self) -> bool
pub fn get_interval_type(&self) -> Result<IntervalType, PbFieldNotFound>
pub fn get_field_type(&self) -> &Vec<DataType>
pub fn get_field_names(&self) -> &Vec<String>
pub fn get_field_ids(&self) -> &Vec<i32>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataType
impl<'de> Deserialize<'de> for DataType
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Message for DataType
impl Message for DataType
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.impl Eq for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request