pub enum Source {
Literal {
values: Vec<LiteralValue>,
},
IntRange {
lo: i64,
hi: i64,
step: i64,
},
Generator {
expr: String,
cardinality_hint: Option<u64>,
},
WorkloadParamList {
name: String,
len_hint: Option<u64>,
},
ContinuousInterval {
interval: Interval,
measure: ProductMeasure,
},
Distribution {
distribution: MeasureName,
support: Interval,
params: Vec<f64>,
},
}Expand description
A clause’s source of values.
Discrete variants produce a stream of Value via the
runtime evaluator; continuous variants describe a measure
that a downstream sampling strategy will draw from.
Variants§
Literal
Literal comma list (e.g., [1, 2, 4, 8]). Stream
producer over the list contents.
Fields
values: Vec<LiteralValue>The values, in order.
IntRange
Integer half-open range lo..hi with optional step.
Default step is 1.
Fields
Generator
Generator function call expressed as a Polydat source string.
Resolved at clause construction; cardinality may be
Unbounded if the generator is open-ended.
Fields
WorkloadParamList
Reference to a workload-level parameter that resolves to a list of values. Cardinality is the parameter’s declared list length.
ContinuousInterval
Real interval (continuous source). Combined with a
measure to form a Continuous cardinality.
Integrability is checked at parse via V8.
Distribution
Named continuous distribution. The distribution carries
its own support; the support field records the
effective interval for V8’s check.
Implementations§
Source§impl Source
impl Source
Sourcepub fn cardinality(&self) -> CardinalityClass
pub fn cardinality(&self) -> CardinalityClass
Declare this source’s cardinality class for use by
clause metadata propagation.
Sourcepub fn is_continuous(&self) -> bool
pub fn is_continuous(&self) -> bool
true if this source is continuous (Continuous /
Distribution variants). Used by V7 (zip must be all
discrete) and V9 (union must be all discrete) without
a full cardinality computation.
Sourcepub fn is_discrete(&self) -> bool
pub fn is_discrete(&self) -> bool
true if this source is discrete (every variant except
the continuous ones).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Source
impl<'de> Deserialize<'de> for Source
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Source, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Source, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Source
impl Serialize for Source
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl SourceEval for Source
impl SourceEval for Source
Source§fn eval_class(&self) -> EvalClass
fn eval_class(&self) -> EvalClass
EvalClass.Source§fn evaluate(
&self,
ctx: Option<&EvalContext<'_>>,
) -> Result<EvaluatedSource, EvalError>
fn evaluate( &self, ctx: Option<&EvalContext<'_>>, ) -> Result<EvaluatedSource, EvalError>
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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