#[repr(i32)]pub enum TypeCode {
Show 15 variants
Unspecified = 0,
Bool = 1,
Int64 = 2,
Float64 = 3,
Float32 = 15,
Timestamp = 4,
Date = 5,
String = 6,
Bytes = 7,
Array = 8,
Struct = 9,
Numeric = 10,
Json = 11,
Proto = 13,
Enum = 14,
}
Expand description
TypeCode
is used as part of [Type][google.spanner.v1.Type] to
indicate the type of a Cloud Spanner value.
Each legal value of a type can be encoded to or decoded from a JSON
value, using the encodings described below. All Cloud Spanner values can
be null
, regardless of type; null
s are always encoded as a JSON
null
.
Variants§
Unspecified = 0
Not specified.
Bool = 1
Encoded as JSON true
or false
.
Int64 = 2
Encoded as string
, in decimal format.
Float64 = 3
Encoded as number
, or the strings "NaN"
, "Infinity"
, or
"-Infinity"
.
Float32 = 15
Encoded as number
, or the strings "NaN"
, "Infinity"
, or
"-Infinity"
.
Timestamp = 4
Encoded as string
in RFC 3339 timestamp format. The time zone
must be present, and must be "Z"
.
If the schema has the column option
allow_commit_timestamp=true
, the placeholder string
"spanner.commit_timestamp()"
can be used to instruct the system
to insert the commit timestamp associated with the transaction
commit.
Date = 5
Encoded as string
in RFC 3339 date format.
String = 6
Encoded as string
.
Bytes = 7
Encoded as a base64-encoded string
, as described in RFC 4648,
section 4.
Array = 8
Encoded as list
, where the list elements are represented
according to
[array_element_type][google.spanner.v1.Type.array_element_type].
Struct = 9
Encoded as list
, where list element i
is represented according
to [struct_type.fields[i]][google.spanner.v1.StructType.fields].
Numeric = 10
Encoded as string
, in decimal format or scientific notation format.
Decimal format:
\[+-\]Digits\[.[Digits]\]
or
[+-][Digits].Digits
Scientific notation:
\[+-\]Digits\[.[Digits\]][ExponentIndicator\[+-\]Digits]
or
[+-][Digits].Digits\[ExponentIndicator[+-\]Digits]
(ExponentIndicator is "e"
or "E"
)
Json = 11
Encoded as a JSON-formatted string
as described in RFC 7159. The
following rules are applied when parsing JSON input:
- Whitespace characters are not preserved.
- If a JSON object has duplicate keys, only the first key is preserved.
- Members of a JSON object are not guaranteed to have their order preserved.
- JSON array elements will have their order preserved.
Proto = 13
Encoded as a base64-encoded string
, as described in RFC 4648,
section 4.
Enum = 14
Encoded as string
, in decimal format.
Implementations§
source§impl TypeCode
impl TypeCode
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl Ord for TypeCode
impl Ord for TypeCode
source§impl PartialEq for TypeCode
impl PartialEq for TypeCode
source§impl PartialOrd for TypeCode
impl PartialOrd for TypeCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<i32> for TypeCode
impl TryFrom<i32> for TypeCode
§type Error = UnknownEnumValue
type Error = UnknownEnumValue
impl Copy for TypeCode
impl Eq for TypeCode
impl StructuralPartialEq for TypeCode
Auto Trait Implementations§
impl Freeze for TypeCode
impl RefUnwindSafe for TypeCode
impl Send for TypeCode
impl Sync for TypeCode
impl Unpin for TypeCode
impl UnwindSafe for TypeCode
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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<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
§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.§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