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>,
}
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.
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>
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Message for DataType
impl Message for DataType
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
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,
Encodes the message to a buffer. Read more
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Encodes the message to a newly allocated buffer.
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,
Encodes the message with a length-delimiter to a buffer. Read more
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,
Encodes the message with a length-delimiter to a newly allocated buffer.
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
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,
Decodes a length-delimited instance of the message from the buffer.
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,
Decodes an instance of the message from a buffer, and merges it into
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,
Decodes a length-delimited instance of the message from buffer, and
merges it into
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
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
Compare self to
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>
Wrap the input message
T
in a tonic::Request