Struct query_structure::ast::Enum
source · pub struct Enum {
pub name: Identifier,
pub values: Vec<EnumValue>,
pub attributes: Vec<Attribute>,
pub span: Span,
pub inner_span: Span,
/* private fields */
}
Expand description
An enum declaration. Enumeration can either be in the database schema, or completely a Prisma level concept.
PostgreSQL stores enums in a schema, while in MySQL the information is in the table definition. On MongoDB the enumerations are handled in the Query Engine.
Fields§
§name: Identifier
The name of the enum.
ⓘ
enum Foo { ... }
^^^
values: Vec<EnumValue>
The values of the enum.
ⓘ
enum Foo {
Value1
^^^^^^
Value2
^^^^^^
}
attributes: Vec<Attribute>
The attributes of this enum.
ⓘ
enum Foo {
Value1
Value2
@@map("1Foo")
^^^^^^^^^^^^^
}
span: Span
The location of this enum in the text representation.
inner_span: Span
The span of the inner contents.
Implementations§
source§impl Enum
impl Enum
pub fn iter_values(&self) -> impl ExactSizeIterator
Trait Implementations§
source§impl Index<EnumValueId> for Enum
impl Index<EnumValueId> for Enum
source§impl WithAttributes for Enum
impl WithAttributes for Enum
source§fn attributes(&self) -> &[Attribute]
fn attributes(&self) -> &[Attribute]
The attributes.
source§impl WithDocumentation for Enum
impl WithDocumentation for Enum
source§fn documentation(&self) -> Option<&str>
fn documentation(&self) -> Option<&str>
The documentation string, if defined.
source§impl WithIdentifier for Enum
impl WithIdentifier for Enum
source§fn identifier(&self) -> &Identifier
fn identifier(&self) -> &Identifier
The identifier.
Auto Trait Implementations§
impl RefUnwindSafe for Enum
impl Send for Enum
impl Sync for Enum
impl Unpin for Enum
impl UnwindSafe for Enum
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