pub enum Type {
Show 38 variants
Array(Box<Type>),
Bool,
Bytea,
Char,
Date,
Float4,
Float8,
Int2,
Int4,
Int8,
UInt2,
UInt4,
UInt8,
Interval {
constraints: Option<IntervalConstraints>,
},
Json,
Jsonb,
List(Box<Type>),
Map {
value_type: Box<Type>,
},
Name,
Numeric {
constraints: Option<NumericConstraints>,
},
Oid,
Record(Vec<Type>),
Text,
BpChar {
length: Option<CharLength>,
},
VarChar {
max_length: Option<CharLength>,
},
Time {
precision: Option<TimePrecision>,
},
TimeTz {
precision: Option<TimePrecision>,
},
Timestamp {
precision: Option<TimestampPrecision>,
},
TimestampTz {
precision: Option<TimestampPrecision>,
},
Uuid,
RegProc,
RegType,
RegClass,
Int2Vector,
MzTimestamp,
Range {
element_type: Box<Type>,
},
MzAclItem,
AclItem,
}
Expand description
Variants§
Array(Box<Type>)
A variable-length multidimensional array of values.
Bool
A boolean value.
Bytea
A byte array, i.e., a variable-length binary string.
Char
A single-byte character.
Date
A date.
Float4
A 4-byte floating point number.
Float8
An 8-byte floating point number.
Int2
A 2-byte signed integer.
Int4
A 4-byte signed integer.
Int8
An 8-byte signed integer.
UInt2
A 2-byte unsigned integer. This does not exist in PostgreSQL.
UInt4
A 4-byte unsigned integer. This does not exist in PostgreSQL.
UInt8
An 8-byte unsigned integer. This does not exist in PostgreSQL.
Interval
A time interval.
Fields
constraints: Option<IntervalConstraints>
Optional constraints on the type.
Json
A textual JSON blob.
Jsonb
A binary JSON blob.
List(Box<Type>)
A sequence of homogeneous values.
Map
A map with text keys and homogeneous values.
Name
A character type for storing identifiers of no more than 64 bytes in length.
Numeric
An arbitrary precision number.
Fields
constraints: Option<NumericConstraints>
Optional constraints on the type.
Oid
An object identifier.
Record(Vec<Type>)
A sequence of heterogeneous values.
Text
A variable-length string.
BpChar
A (usually) fixed-length string.
Fields
length: Option<CharLength>
The length of the string.
If unspecified, the type represents a variable-length string.
VarChar
A variable-length string with an optional limit.
Fields
max_length: Option<CharLength>
An optional maximum length to enforce, in characters.
Time
A time of day without a day.
Fields
precision: Option<TimePrecision>
An optional precision for the fractional digits in the second field.
TimeTz
A time with a time zone.
Fields
precision: Option<TimePrecision>
An optional precision for the fractional digits in the second field.
Timestamp
A date and time, without a timezone.
Fields
precision: Option<TimestampPrecision>
An optional precision for the fractional digits in the second field.
TimestampTz
A date and time, with a timezone.
Fields
precision: Option<TimestampPrecision>
An optional precision for the fractional digits in the second field.
Uuid
A universally unique identifier.
RegProc
A function name.
RegType
A type name.
RegClass
A class name.
Int2Vector
A small int vector.
MzTimestamp
A Materialize timestamp.
Range
A range of values of the inner type.
MzAclItem
A list of privileges granted to a user, that uses mz_repr::role_id::RoleId
s for role
references.
AclItem
A list of privileges granted to a user that uses mz_repr::adt::system::Oid
s for role
references. This type is used primarily for compatibility with PostgreSQL.
Implementations§
source§impl Type
impl Type
sourcepub fn from_oid(oid: u32) -> Result<Type, TypeFromOidError>
pub fn from_oid(oid: u32) -> Result<Type, TypeFromOidError>
Returns the type corresponding to the provided OID, if the OID is known.
sourcepub fn from_oid_and_typmod(
oid: u32,
typmod: i32,
) -> Result<Type, TypeFromOidError>
pub fn from_oid_and_typmod( oid: u32, typmod: i32, ) -> Result<Type, TypeFromOidError>
pub(crate) fn inner(&self) -> &'static Type
sourcepub fn catalog_name(&self) -> &'static str
pub fn catalog_name(&self) -> &'static str
Returns the item’s name in a way that guarantees it’s resolvable in the catalog.
sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Returns the user-friendly name that PostgreSQL uses for this type.
sourcepub fn constraint(&self) -> Option<&dyn TypeConstraint>
pub fn constraint(&self) -> Option<&dyn TypeConstraint>
Returns the constraint on the type, if any.
sourcepub fn typlen(&self) -> i16
pub fn typlen(&self) -> i16
Returns the number of bytes in the binary representation of this type, or -1 if the type has a variable-length representation.
sourcepub fn typmod(&self) -> i32
pub fn typmod(&self) -> i32
Returns the packed type modifier (“typmod”) for the type.
The typmod is a 32-bit integer associated with the type that encodes
optional constraints on the type. For example, the typmod on
Type::VarChar
encodes an optional constraint on the value’s length.
Most types are never associated with a typmod.
Negative typmods indicate no constraint.
Trait Implementations§
source§impl From<&ScalarType> for Type
impl From<&ScalarType> for Type
source§fn from(typ: &ScalarType) -> Type
fn from(typ: &ScalarType) -> Type
source§impl TryFrom<&Type> for ScalarType
impl TryFrom<&Type> for ScalarType
§type Error = TypeConversionError
type Error = TypeConversionError
source§fn try_from(typ: &Type) -> Result<ScalarType, TypeConversionError>
fn try_from(typ: &Type) -> Result<ScalarType, TypeConversionError>
impl Eq 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> 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
source§impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.