Skip to main content

ColumnGen

Enum ColumnGen 

Source
pub enum ColumnGen {
    Field {
        field: &'static Field,
        modifier: String,
        transform: Transform,
        range: Option<RangeSpec>,
        ordering: Ordering,
        omit_pct: Option<u8>,
        zipf: Option<ZipfSpec>,
    },
    Literal(String),
    Aggr {
        func: AggrFunc,
        source_col: String,
        group_by: Option<String>,
    },
    Ref {
        source_col: String,
        modifier: String,
    },
    Expr {
        left: ExprOperand,
        op: ExprOp,
        right: ExprOperand,
        result_type: ExprResultType,
    },
    Fk {
        parent_table: String,
        parent_col_name: String,
        parent_field: &'static Field,
        parent_modifier: String,
        parent_range: Option<RangeSpec>,
        parent_ordering: Ordering,
        parent_count: u64,
        distribution: FkDistribution,
        parent_domain_hash: u64,
        parent_ctx: Box<ParentCtx>,
    },
    FkDeref {
        anchor_col: String,
        deref_col_name: String,
        deref_field: &'static Field,
        deref_modifier: String,
        deref_range: Option<RangeSpec>,
        deref_ordering: Ordering,
        deref_domain_hash: u64,
        parent_ctx: Box<ParentCtx>,
    },
}

Variants§

§

Field

Fields

§field: &'static Field
§modifier: String
§transform: Transform
§ordering: Ordering
§omit_pct: Option<u8>
§

Literal(String)

§

Aggr

Fields

§source_col: String
§group_by: Option<String>
§

Ref

Fields

§source_col: String
§modifier: String
§

Expr

Fields

§result_type: ExprResultType
§

Fk

Foreign-key anchor: samples a row from the parent table and generates the parent field value. parent_domain_hash is zero at parse time; set by finalize_fk_columns.

Fields

§parent_table: String
§parent_col_name: String
§parent_field: &'static Field
§parent_modifier: String
§parent_range: Option<RangeSpec>
§parent_ordering: Ordering

Ordering of the parent column (asc/desc/none). Propagated into the GenContext used to regenerate the parent field value, otherwise monotonic fields like timestamp:asc fall back to random output.

§parent_count: u64
§distribution: FkDistribution
§parent_domain_hash: u64

Pre-computed hash of the parent field; set at orchestration time.

§parent_ctx: Box<ParentCtx>
§

FkDeref

Foreign-key dereference: reuses the row index sampled by an Fk anchor column in this table to generate a different field of the same parent row. deref_domain_hash is zero at parse time; set by finalize_fk_columns.

Fields

§anchor_col: String
§deref_col_name: String
§deref_field: &'static Field
§deref_modifier: String
§deref_range: Option<RangeSpec>
§deref_ordering: Ordering

Ordering of the dereferenced parent column — same role as parent_ordering.

§deref_domain_hash: u64

Pre-computed hash of the dereferenced parent field; set at orchestration time.

§parent_ctx: Box<ParentCtx>

Trait Implementations§

Source§

impl Clone for ColumnGen

Source§

fn clone(&self) -> ColumnGen

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ColumnGen

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

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> 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> 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.