Skip to main content

SyntheticModel

Struct SyntheticModel 

Source
pub struct SyntheticModel {
    pub schema_ref: Option<String>,
    pub version: u32,
    pub kind: ModelKind,
    pub imports: Vec<PathBuf>,
    pub source: Option<SourceModel>,
    pub defaults: ModelDefaults,
    pub seed: Option<u64>,
    pub output: OutputModel,
    pub tables: BTreeMap<String, TableModel>,
    pub profiles: BTreeMap<String, ProfileMetadata>,
}
Expand description

A complete, self-contained synthetic data model.

Fields§

§schema_ref: Option<String>

Editor-only schema pointer (e.g. # yaml-language-server: $schema=... promoted into the document body, or a literal $schema: key). Purely documentation metadata: recognized so an editor-annotated document doesn’t trip deny_unknown_fields, never read by the parser.

§version: u32§kind: ModelKind§imports: Vec<PathBuf>§source: Option<SourceModel>§defaults: ModelDefaults§seed: Option<u64>§output: OutputModel§tables: BTreeMap<String, TableModel>§profiles: BTreeMap<String, ProfileMetadata>

Implementations§

Source§

impl SyntheticModel

Source

pub const SOURCE_LITERAL_GENERATORS: &'static [&'static str]

Generator kinds that persist literal values drawn from the source dump. A rule using one of these replays real observed values, so it must raise the conservative source-derived safety notice.

Source

pub fn source_value_uses(&self) -> Vec<SourceValueUse>

Scan every explicit and inferred rule for source-derived literal uses.

This never returns the literal values themselves — only where they live and what kind of rule carries them — so the result is safe to print or serialize into a JSON report. Categorical/constant/observed-sample generators, source DEFAULTs a column defers to, and verbatim CHECK constraints all count.

Source

pub fn freeze_row_counts( &mut self, resolved: &BTreeMap<String, u64>, family_children: &HashSet<String>, )

Rewrite each table’s rows count to the resolved value from a compiled plan. Already-authoritative fixed/observed counts keep their kind; derived scale/relation.children policies become fixed so a reload cannot derive a different count, except for named relation children whose distribution is still consumed by a cross-table family planner.

An observed table stays kind: observed with a frozen integer count, which is what --emit-config needs for a self-contained model that reproduces the same row counts on reload without re-passing volume flags. Tables absent from resolved are left untouched.

Trait Implementations§

Source§

impl Clone for SyntheticModel

Source§

fn clone(&self) -> SyntheticModel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SyntheticModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SyntheticModel

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for SyntheticModel

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for SyntheticModel

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> Fake for T

Source§

fn fake<U>(&self) -> U
where Self: FakeBase<U>,

Source§

fn fake_with_rng<U, R>(&self, rng: &mut R) -> U
where R: RngExt + ?Sized, Self: FakeBase<U>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V