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.
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.
Oid
An object identifier.
Record(Vec<Type>)
A sequence of heterogeneous values.
Text
A variable-length string.
BpChar
Fields
A (usually) fixed-length string.
VarChar
A variable-length string with an optional limit.
Time
Fields
A time of day without a day.
TimeTz
Fields
A time with a time zone.
Timestamp
Fields
A date and time, without a timezone.
TimestampTz
Fields
A date and time, with a timezone.
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>
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 PartialEq<Type> for Type
impl PartialEq<Type> for 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 StructuralEq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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<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
.