pub enum Type {
Bool,
Int64,
Float64,
String,
Bytes,
Json,
Numeric,
Timestamp,
Date,
Array(Box<Type>),
Struct(StructType),
}Expand description
An enumeration of all Cloud Spanner data types.
Refer to the Cloud Spanner documentation for detailed information about individual data types.
Variants§
Bool
The BOOL data type.
- Storage size: 1 byte
Int64
The INT64 data type.
- Storage size: 8 bytes
- Range:
-9,223,372,036,854,775,808to9,223,372,036,854,775,807
Float64
String
Bytes
The BYTES data type.
- Storage: the number of bytes
Json
The JSON data type.
Note that the JSON document will be canonicalized before storing. Refer to the Cloud Spanner for details.
- Storage: The number of bytes in UTF-8 encoding of the JSON-formatted string equivalent after canonicalization.
Numeric
The NUMERIC data type.
- Storage: varies between 6 and 22 bytes, except for the value 0 which uses 1 byte.
Timestamp
The TIMESTAMP data type.
Refer to the Cloud Spanner documentation for details on timezones and format when used in SQL statements.
- Storage: 12 bytes
- Range:
0001-01-01 00:00:00to9999-12-31 23:59:59.999999999UTC.
Date
The DATE data type.
- Storage: 4 bytes
- Range:
0001-01-01to9999-12-31. - Canonical format:
YYYY-[M]M-[D]D
Array(Box<Type>)
The ARRAY data type.
Can contain elements of any other type except Array (i.e.: arrays of arrays are not allowed).
Can contain NULL elements.
A NULL value of type array and an empty array are different values.
- Storage: the sum of the size of its elements
Struct(StructType)
The STRUCT data type.
Implementations§
Trait Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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::RequestSource§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