pub struct Type {
pub code: i32,
pub array_element_type: Option<Box<Type>>,
pub struct_type: Option<StructType>,
pub type_annotation: i32,
pub proto_type_fqn: String,
}
Expand description
Type
indicates the type of a Cloud Spanner value, as might be stored in a
table cell or returned from an SQL query.
Fields§
§code: i32
Required. The [TypeCode][google.spanner.v1.TypeCode] for this type.
array_element_type: Option<Box<Type>>
If [code][google.spanner.v1.Type.code] == [ARRAY][google.spanner.v1.TypeCode.ARRAY], then array_element_type
is the type of the array elements.
struct_type: Option<StructType>
If [code][google.spanner.v1.Type.code] == [STRUCT][google.spanner.v1.TypeCode.STRUCT], then struct_type
provides type information for the struct’s fields.
type_annotation: i32
The [TypeAnnotationCode][google.spanner.v1.TypeAnnotationCode] that disambiguates SQL type that Spanner will use to represent values of this type during query processing. This is necessary for some type codes because a single [TypeCode][google.spanner.v1.TypeCode] can be mapped to different SQL types depending on the SQL dialect. [type_annotation][google.spanner.v1.Type.type_annotation] typically is not needed to process the content of a value (it doesn’t affect serialization) and clients can ignore it on the read path.
proto_type_fqn: String
If [code][google.spanner.v1.Type.code] ==
[PROTO][google.spanner.v1.TypeCode.PROTO] or
[code][google.spanner.v1.Type.code] ==
[ENUM][google.spanner.v1.TypeCode.ENUM], then proto_type_fqn
is the fully
qualified name of the proto type representing the proto/enum definition.
Implementations§
source§impl Type
impl Type
sourcepub fn code(&self) -> TypeCode
pub fn code(&self) -> TypeCode
Returns the enum value of code
, or the default if the field is set to an invalid enum value.
sourcepub fn type_annotation(&self) -> TypeAnnotationCode
pub fn type_annotation(&self) -> TypeAnnotationCode
Returns the enum value of type_annotation
, or the default if the field is set to an invalid enum value.
sourcepub fn set_type_annotation(&mut self, value: TypeAnnotationCode)
pub fn set_type_annotation(&mut self, value: TypeAnnotationCode)
Sets type_annotation
to the provided enum value.
Trait Implementations§
source§impl Message for Type
impl Message for Type
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
.source§impl PartialEq for Type
impl PartialEq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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<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