pub enum TypeKind {
Show 29 variants
Boolean,
I8,
I16,
I32,
I64,
Fp32,
Fp64,
String,
Binary,
Date,
IntervalYear,
Uuid,
FixedChar {
length: IntegerParameter,
},
VarChar {
length: IntegerParameter,
},
FixedBinary {
length: IntegerParameter,
},
Decimal {
precision: IntegerParameter,
scale: IntegerParameter,
},
PrecisionTime {
precision: IntegerParameter,
},
PrecisionTimestamp {
precision: IntegerParameter,
},
PrecisionTimestampTz {
precision: IntegerParameter,
},
IntervalDay {
precision: IntegerParameter,
},
IntervalCompound {
precision: IntegerParameter,
},
Extension {
name: String,
parameters: Vec<TypeParameter>,
},
List(Box<Type>),
Map {
key: Box<Type>,
value: Box<Type>,
},
Struct(Vec<Type>),
NamedStruct {
fields: IndexMap<String, Type>,
},
Func {
parameters: Vec<Type>,
return_type: Box<Type>,
},
Any,
Variable {
id: u32,
},
}parse only.Expand description
The structure of a type expression, without its nullability.
Variants§
Boolean
Boolean type - bool
I8
8-bit signed integer - i8
I16
16-bit signed integer - i16
I32
32-bit signed integer - i32
I64
64-bit signed integer - i64
Fp32
32-bit floating point - fp32
Fp64
64-bit floating point - fp64
String
Variable-length string - string
Binary
Variable-length binary data - binary
Date
Calendar date - date
IntervalYear
Year-month interval - interval_year
Uuid
128-bit UUID - uuid
FixedChar
Fixed-length character string: fixedchar<L>
Fields
length: IntegerParameterLength (number of characters), must be >= 1
VarChar
Variable-length character string: varchar<L>
Fields
length: IntegerParameterMaximum length (number of characters), must be >= 1
FixedBinary
Fixed-length binary data: fixedbinary<L>
Fields
length: IntegerParameterLength (number of bytes), must be >= 1
Decimal
Fixed-point decimal: decimal<P, S>
Fields
precision: IntegerParameterPrecision (total digits), <= 38
scale: IntegerParameterScale (digits after decimal point), 0 <= S <= P
PrecisionTime
Time with sub-second precision: precision_time<P>
Fields
precision: IntegerParameterSub-second precision digits (0-12: seconds to picoseconds)
PrecisionTimestamp
Timestamp with sub-second precision: precision_timestamp<P>
Fields
precision: IntegerParameterSub-second precision digits (0-12: seconds to picoseconds)
PrecisionTimestampTz
Timezone-aware timestamp with precision: precision_timestamp_tz<P>
Fields
precision: IntegerParameterSub-second precision digits (0-12: seconds to picoseconds)
IntervalDay
Day-time interval: interval_day<P>
Fields
precision: IntegerParameterSub-second precision digits (0-9: seconds to nanoseconds)
IntervalCompound
Compound interval: interval_compound<P>
Fields
precision: IntegerParameterSub-second precision digits
Extension
Extension type with optional parameters
List(Box<Type>)
List type with element type
Map
Map type with key and value types
Struct(Vec<Type>)
Struct type (ordered fields without names)
NamedStruct
Named struct type (nstruct - ordered fields with names)
Fields
Func
A function type: func<(P1, P2) -> R>
Fields
Any
An unnumbered wildcard, such as any.
Variable
A numbered type variable, such as any1.
Implementations§
Trait Implementations§
Source§impl Display for TypeKind
Formats the full type spelling used in extension YAML, not the short name
used in function signatures (e.g., precision_timestamp<3>, not pts).
impl Display for TypeKind
Formats the full type spelling used in extension YAML, not the short name
used in function signatures (e.g., precision_timestamp<3>, not pts).