pub struct TypeDecl {
pub name: Ident,
pub fields: Vec<FieldDecl>,
pub span: Span,
}Expand description
A composite type block declaration.
Composite types define named struct-like types that can be embedded in models.
On PostgreSQL they map to native composite types; on MySQL/SQLite they are
serialised to JSON (@store(Json) is required on the model field).
§Example
type Address {
street String
city String
zip String
}Fields§
§name: IdentThe type name (e.g., “Address”).
fields: Vec<FieldDecl>Field declarations (scalars, enums, and arrays — no relations).
span: SpanSpan covering the entire type block.
Implementations§
Trait Implementations§
impl StructuralPartialEq for TypeDecl
Auto Trait Implementations§
impl Freeze for TypeDecl
impl RefUnwindSafe for TypeDecl
impl Send for TypeDecl
impl Sync for TypeDecl
impl Unpin for TypeDecl
impl UnsafeUnpin for TypeDecl
impl UnwindSafe for TypeDecl
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