toasty_core/schema/app/
embedded.rs

1use crate::{
2    schema::app::{Model, ModelId, Schema},
3    stmt,
4};
5
6#[derive(Debug, Clone)]
7pub struct Embedded {
8    /// The embedded model being referenced
9    pub target: ModelId,
10
11    /// The embedded field's expression type. This is the type the field evaluates
12    /// to from a user's point of view.
13    pub expr_ty: stmt::Type,
14}
15
16impl Embedded {
17    pub fn target<'a>(&self, schema: &'a Schema) -> &'a Model {
18        schema.model(self.target)
19    }
20}