Enum google_cloud_googleapis::spanner::v1::TypeCode[][src]

#[repr(i32)]
pub enum TypeCode {
    Unspecified,
    Bool,
    Int64,
    Float64,
    Timestamp,
    Date,
    String,
    Bytes,
    Array,
    Struct,
    Numeric,
    Json,
}
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; nulls are always encoded as a JSON null.

Variants

Unspecified

Not specified.

Bool

Encoded as JSON true or false.

Int64

Encoded as string, in decimal format.

Float64

Encoded as number, or the strings "NaN", "Infinity", or "-Infinity".

Timestamp

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

Encoded as string in RFC 3339 date format.

String

Encoded as string.

Bytes

Encoded as a base64-encoded string, as described in RFC 4648, section 4.

Array

Encoded as list, where the list elements are represented according to [array_element_type][google.spanner.v1.Type.array_element_type].

Struct

Encoded as list, where list element i is represented according to [struct_type.fields[i]][google.spanner.v1.StructType.fields].

Numeric

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

Encoded as a JSON-formatted ‘string’ as described in RFC 7159. The following rules will be applied when parsing JSON input:

  • Whitespace will be stripped from the document.
  • If a JSON object has duplicate keys, only the first key will be preserved.
  • Members of a JSON object are not guaranteed to have their order preserved. JSON array elements will have their order preserved.

Implementations

Returns true if value is a variant of TypeCode.

Converts an i32 to a TypeCode, or None if value is not a valid variant.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Wrap the input message T in a tonic::Request

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more