#[non_exhaustive]pub struct StandardSqlDataType {
pub type_kind: TypeKind,
pub sub_type: Option<SubType>,
/* private fields */
}Expand description
The data type of a variable such as a function argument. Examples include:
-
INT64:
{"typeKind": "INT64"} -
ARRAY<STRING>:
{ “typeKind”: “ARRAY”, “arrayElementType”: {“typeKind”: “STRING”} }
-
STRUCT<x STRING, y ARRAY<DATE>>:
{ “typeKind”: “STRUCT”, “structType”: { “fields”: [ { “name”: “x”, “type”: {“typeKind”: “STRING”} }, { “name”: “y”, “type”: { “typeKind”: “ARRAY”, “arrayElementType”: {“typeKind”: “DATE”} } } ] } }
-
RANGE<DATE>:
{ “typeKind”: “RANGE”, “rangeElementType”: {“typeKind”: “DATE”} }
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.type_kind: TypeKindRequired. The top level type of this field. Can be any GoogleSQL data type (e.g., “INT64”, “DATE”, “ARRAY”).
sub_type: Option<SubType>For complex types, the sub type information.
Implementations§
Source§impl StandardSqlDataType
impl StandardSqlDataType
Sourcepub fn set_type_kind<T: Into<TypeKind>>(self, v: T) -> Self
pub fn set_type_kind<T: Into<TypeKind>>(self, v: T) -> Self
Sets the value of type_kind.
§Example
use google_cloud_bigquery_v2::model::standard_sql_data_type::TypeKind;
let x0 = StandardSqlDataType::new().set_type_kind(TypeKind::Int64);
let x1 = StandardSqlDataType::new().set_type_kind(TypeKind::Bool);
let x2 = StandardSqlDataType::new().set_type_kind(TypeKind::Float64);Sourcepub fn set_sub_type<T: Into<Option<SubType>>>(self, v: T) -> Self
pub fn set_sub_type<T: Into<Option<SubType>>>(self, v: T) -> Self
Sourcepub fn array_element_type(&self) -> Option<&Box<StandardSqlDataType>>
pub fn array_element_type(&self) -> Option<&Box<StandardSqlDataType>>
The value of sub_type
if it holds a ArrayElementType, None if the field is not set or
holds a different branch.
Sourcepub fn set_array_element_type<T: Into<Box<StandardSqlDataType>>>(
self,
v: T,
) -> Self
pub fn set_array_element_type<T: Into<Box<StandardSqlDataType>>>( self, v: T, ) -> Self
Sets the value of sub_type
to hold a ArrayElementType.
Note that all the setters affecting sub_type are
mutually exclusive.
§Example
let x = StandardSqlDataType::new().set_array_element_type(StandardSqlDataType::default()/* use setters */);
assert!(x.array_element_type().is_some());
assert!(x.struct_type().is_none());
assert!(x.range_element_type().is_none());Sourcepub fn struct_type(&self) -> Option<&Box<StandardSqlStructType>>
pub fn struct_type(&self) -> Option<&Box<StandardSqlStructType>>
The value of sub_type
if it holds a StructType, None if the field is not set or
holds a different branch.
Sourcepub fn set_struct_type<T: Into<Box<StandardSqlStructType>>>(self, v: T) -> Self
pub fn set_struct_type<T: Into<Box<StandardSqlStructType>>>(self, v: T) -> Self
Sets the value of sub_type
to hold a StructType.
Note that all the setters affecting sub_type are
mutually exclusive.
§Example
use google_cloud_bigquery_v2::model::StandardSqlStructType;
let x = StandardSqlDataType::new().set_struct_type(StandardSqlStructType::default()/* use setters */);
assert!(x.struct_type().is_some());
assert!(x.array_element_type().is_none());
assert!(x.range_element_type().is_none());Sourcepub fn range_element_type(&self) -> Option<&Box<StandardSqlDataType>>
pub fn range_element_type(&self) -> Option<&Box<StandardSqlDataType>>
The value of sub_type
if it holds a RangeElementType, None if the field is not set or
holds a different branch.
Sourcepub fn set_range_element_type<T: Into<Box<StandardSqlDataType>>>(
self,
v: T,
) -> Self
pub fn set_range_element_type<T: Into<Box<StandardSqlDataType>>>( self, v: T, ) -> Self
Sets the value of sub_type
to hold a RangeElementType.
Note that all the setters affecting sub_type are
mutually exclusive.
§Example
let x = StandardSqlDataType::new().set_range_element_type(StandardSqlDataType::default()/* use setters */);
assert!(x.range_element_type().is_some());
assert!(x.array_element_type().is_none());
assert!(x.struct_type().is_none());Trait Implementations§
Source§impl Clone for StandardSqlDataType
impl Clone for StandardSqlDataType
Source§fn clone(&self) -> StandardSqlDataType
fn clone(&self) -> StandardSqlDataType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StandardSqlDataType
impl Debug for StandardSqlDataType
Source§impl Default for StandardSqlDataType
impl Default for StandardSqlDataType
Source§fn default() -> StandardSqlDataType
fn default() -> StandardSqlDataType
Source§impl Message for StandardSqlDataType
impl Message for StandardSqlDataType
Source§impl PartialEq for StandardSqlDataType
impl PartialEq for StandardSqlDataType
impl StructuralPartialEq for StandardSqlDataType
Auto Trait Implementations§
impl Freeze for StandardSqlDataType
impl RefUnwindSafe for StandardSqlDataType
impl Send for StandardSqlDataType
impl Sync for StandardSqlDataType
impl Unpin for StandardSqlDataType
impl UnsafeUnpin for StandardSqlDataType
impl UnwindSafe for StandardSqlDataType
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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