pub struct Embedded {
pub target: ModelId,
pub expr_ty: Type,
}Expand description
A reference to an embedded model (struct or enum) that is stored inline within its parent model’s table rather than in a separate table.
Embedded fields are flattened into the parent table’s columns at the database level, but appear as nested types at the application level.
§Examples
ⓘ
use toasty_core::schema::app::Embedded;
// Embedded is typically constructed by the schema builder.
let embedded: &Embedded = field.ty.as_embedded_unwrap();
let target_model = embedded.target(&schema);Fields§
§target: ModelIdThe ModelId of the embedded model being referenced.
expr_ty: TypeThe expression type of this embedded field from the application’s perspective.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Embedded
impl RefUnwindSafe for Embedded
impl Send for Embedded
impl Sync for Embedded
impl Unpin for Embedded
impl UnwindSafe for Embedded
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