Enum parser_database::ScalarFieldType
source · pub enum ScalarFieldType {
CompositeType(CompositeTypeId),
Enum(EnumId),
BuiltInScalar(ScalarType),
Unsupported(UnsupportedType),
}
Expand description
The type of a scalar field, parsed and categorized.
Variants§
CompositeType(CompositeTypeId)
A composite type
Enum(EnumId)
An enum
BuiltInScalar(ScalarType)
A Prisma scalar type
Unsupported(UnsupportedType)
An Unsupported("...")
type
Implementations§
source§impl ScalarFieldType
impl ScalarFieldType
sourcepub fn as_builtin_scalar(self) -> Option<ScalarType>
pub fn as_builtin_scalar(self) -> Option<ScalarType>
Try to interpret this field type as a known Prisma scalar type.
sourcepub fn as_composite_type(self) -> Option<CompositeTypeId>
pub fn as_composite_type(self) -> Option<CompositeTypeId>
Try to interpret this field type as a Composite Type.
sourcepub fn is_unsupported(self) -> bool
pub fn is_unsupported(self) -> bool
Is the type of the field Unsupported("...")
?
sourcepub fn is_datetime(self) -> bool
pub fn is_datetime(self) -> bool
True if the field’s type is DateTime.
sourcepub fn is_decimal(self) -> bool
pub fn is_decimal(self) -> bool
True if the field’s type is Decimal.
Trait Implementations§
source§impl Clone for ScalarFieldType
impl Clone for ScalarFieldType
source§fn clone(&self) -> ScalarFieldType
fn clone(&self) -> ScalarFieldType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ScalarFieldType
impl Debug for ScalarFieldType
source§impl PartialEq for ScalarFieldType
impl PartialEq for ScalarFieldType
source§fn eq(&self, other: &ScalarFieldType) -> bool
fn eq(&self, other: &ScalarFieldType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for ScalarFieldType
impl StructuralPartialEq for ScalarFieldType
Auto Trait Implementations§
impl RefUnwindSafe for ScalarFieldType
impl Send for ScalarFieldType
impl Sync for ScalarFieldType
impl Unpin for ScalarFieldType
impl UnwindSafe for ScalarFieldType
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
Mutably borrows from an owned value. Read more