Checked contract types#
check_contract returns parcel_core::check::CheckedContract. These types contain checked definitions; executable plans are created by compilation.
CheckedContract#
Field |
Type |
Meaning |
|---|---|---|
|
|
Contract name. |
|
|
Version number. |
|
|
Canonical document hash. |
|
|
Resolved owner. |
|
|
Resolved data location. |
|
|
Resolved placement requirements. |
|
|
Checked output columns. |
|
|
Typed rule definitions. |
|
|
Required function identities. |
|
|
Declared extension types. |
|
|
Custom row field names paired with checked calculations. |
|
|
Custom dataset calculations. |
CheckedExpr and ExposedColumn#
Type |
Public fields |
|---|---|
|
|
|
|
|
|
CheckedRule#
pub enum CheckedRule {
Decide { id: String, expr: CheckedExpr },
Admit { id: String, expr: CheckedExpr },
Assert { id: String, expr: CheckedExpr, on_fail: AssertOnFail },
Transform { id: String, column: String, expr: CheckedExpr },
Guarantee { id: String, expr: CheckedExpr, on_fail: GuaranteeOnFail },
Shape { id: String, shape: ShapeOp, unless: Option<CheckedExpr> },
}
id identifies the rule, expr contains its checked condition or calculation, column identifies a transformed output, and on_fail records the failure action. shape contains the checked shape parameters; unless can exempt a caller.
impl CheckedRule {
pub fn id(&self) -> &str;
pub fn exprs(&self) -> Vec<&CheckedExpr>;
}
id borrows the identifier. exprs borrows the rule’s expressions; for a shape it returns its unless expression if present.
Dataset producers#
Producer has public fields field: String, ty: Type, and kind: ProducerKind.
ProducerKind is Constant(parcel_core::ir::Lit) or Aggregate { func: Aggregate, arg: Option<CheckedExpr> }. Aggregate variants are Count, Sum, Avg, Min, Max, CountDistinct, and Median.
Residency#
parcel_core::Residency contains jurisdictions: BTreeSet<String> and approved_output_may_leave: bool.
Method |
Meaning |
|---|---|
|
Tests whether a recognized jurisdiction code is in the allowed set. |
|
Rejects an empty set or unknown codes. |
The accepted codes are the implementation’s ISO two-letter country codes and EU. default() creates an empty set and sets output release to false.