necoherence/semantic_types
Types
pub type ArraySpec {
ArraySpec(
item: ElementContract,
min_length: option.Option(Int),
max_length: option.Option(Int),
)
}
Constructors
-
ArraySpec( item: ElementContract, min_length: option.Option(Int), max_length: option.Option(Int), )
pub type BooleanSpec {
BooleanSpec(
const_value: option.Option(Bool),
default_value: option.Option(Bool),
)
}
Constructors
-
BooleanSpec( const_value: option.Option(Bool), default_value: option.Option(Bool), )
pub type BranchSelector {
InternalTag
MemberShape(tests: List(#(String, MemberTest)))
Kind(kind: ValueKind)
Otherwise
}
Constructors
-
InternalTag -
MemberShape(tests: List(#(String, MemberTest))) -
Kind(kind: ValueKind) -
Otherwise
pub type BytesAlphabet {
Standard
UrlSafe
Either
}
Constructors
-
Standard -
UrlSafe -
Either
pub type BytesPolicy {
BytesPolicy(
reference: ProfileRef,
padding_optional: Bool,
alphabet: BytesAlphabet,
strict_pad_bits: Bool,
wrapper: option.Option(String),
)
}
Constructors
-
BytesPolicy( reference: ProfileRef, padding_optional: Bool, alphabet: BytesAlphabet, strict_pad_bits: Bool, wrapper: option.Option(String), )
pub type CalendarRule {
CalendarRule(
allow_second_60: Bool,
minimum_year: Int,
maximum_year: Int,
reject_utc_year_outside_range: Bool,
)
}
Constructors
-
CalendarRule( allow_second_60: Bool, minimum_year: Int, maximum_year: Int, reject_utc_year_outside_range: Bool, )
CheckedProfile
opaquepub opaque type CheckedProfile
pub type CodepointRange {
CodepointRange(first: Int, last: Int)
}
Constructors
-
CodepointRange(first: Int, last: Int)
pub type DecimalBound {
DecimalBound(mantissa: Int, scale: Int, exclusive: Bool)
}
Constructors
-
DecimalBound(mantissa: Int, scale: Int, exclusive: Bool)
pub type DecimalSpec {
DecimalSpec(
minimum: option.Option(DecimalBound),
maximum: option.Option(DecimalBound),
)
}
Constructors
-
DecimalSpec( minimum: option.Option(DecimalBound), maximum: option.Option(DecimalBound), )
pub type DfaSpec {
DfaSpec(
state_count: Int,
initial_state: Int,
accepting_states: List(Int),
transitions: List(DfaTransition),
)
}
Constructors
-
DfaSpec( state_count: Int, initial_state: Int, accepting_states: List(Int), transitions: List(DfaTransition), )
pub type DfaTransition {
DfaTransition(
from_state: Int,
first: Int,
last: Int,
to_state: Int,
)
}
Constructors
-
DfaTransition( from_state: Int, first: Int, last: Int, to_state: Int, )
pub type EffectPoint {
HttpRequestResponse
DataOnly
}
Constructors
-
HttpRequestResponse -
DataOnly
pub type ExtraMembers {
RejectExtras
AllowExtras(
key_format: option.Option(FormatUse),
value: ElementContract,
)
}
Constructors
-
RejectExtras -
AllowExtras( key_format: option.Option(FormatUse), value: ElementContract, )
pub type FieldSpec {
FieldSpec(
wire_name: String,
slot: SlotContract,
origin: OccurrenceRef,
)
}
Constructors
-
FieldSpec( wire_name: String, slot: SlotContract, origin: OccurrenceRef, )
pub type FormatBinding {
FormatBinding(
name: String,
reference: ProfileRef,
rule: FormatRule,
)
}
Constructors
-
FormatBinding( name: String, reference: ProfileRef, rule: FormatRule, )
pub type FormatRule {
Literal(value: String)
Sequence(parts: List(FormatRule))
Optional(rule: FormatRule)
Labels(
separator: String,
min_count: Int,
max_count: option.Option(Int),
total_max: option.Option(Int),
rule: FormatRule,
)
Bounded(unit: StringLengthUnit, maximum: Int, rule: FormatRule)
AsciiDfa(spec: DfaSpec)
Identifier(
first_alphabet: String,
rest_alphabet: String,
exact_length: option.Option(Int),
min_length: Int,
max_length: option.Option(Int),
forbidden: List(String),
)
Text
Not(rule: FormatRule)
Timestamp(rule: CalendarRule)
AbsoluteUri(max_bytes: Int)
LanguageTag(grandfathered: List(String))
Choice(rules: List(FormatRule))
}
Constructors
-
Literal(value: String) -
Sequence(parts: List(FormatRule)) -
Optional(rule: FormatRule) -
Labels( separator: String, min_count: Int, max_count: option.Option(Int), total_max: option.Option(Int), rule: FormatRule, ) -
Bounded(unit: StringLengthUnit, maximum: Int, rule: FormatRule) -
AsciiDfa(spec: DfaSpec) -
Identifier( first_alphabet: String, rest_alphabet: String, exact_length: option.Option(Int), min_length: Int, max_length: option.Option(Int), forbidden: List(String), ) -
Text -
Not(rule: FormatRule) -
Timestamp(rule: CalendarRule) -
AbsoluteUri(max_bytes: Int) -
LanguageTag(grandfathered: List(String)) -
Choice(rules: List(FormatRule))
pub type FormatUse {
NamedFormat(name: String)
InlineFormat(rule: FormatRule)
}
Constructors
-
NamedFormat(name: String) -
InlineFormat(rule: FormatRule)
pub type GraphemeComponent {
GraphemeComponent(
unicode_version: String,
uax29_revision: String,
cluster_profile: String,
)
}
Constructors
-
GraphemeComponent( unicode_version: String, uax29_revision: String, cluster_profile: String, )
pub type GraphemeProperty {
Other
Cr
Lf
Control
Extend
Zwj
RegionalIndicator
Prepend
SpacingMark
L
V
T
Lv
Lvt
}
Constructors
-
Other -
Cr -
Lf -
Control -
Extend -
Zwj -
RegionalIndicator -
Prepend -
SpacingMark -
L -
V -
T -
Lv -
Lvt
pub type GraphemeRange {
GraphemeRange(
first: Int,
last: Int,
property: GraphemeProperty,
)
}
Constructors
-
GraphemeRange(first: Int, last: Int, property: GraphemeProperty)
pub type GraphemeRules {
GraphemeRules(
reference: ProfileRef,
properties: List(GraphemeRange),
extended_pictographic: List(CodepointRange),
indic_conjunct: List(IndicRange),
component: GraphemeComponent,
table_sha256: String,
sources: List(GraphemeSource),
)
}
Constructors
-
GraphemeRules( reference: ProfileRef, properties: List(GraphemeRange), extended_pictographic: List(CodepointRange), indic_conjunct: List(IndicRange), component: GraphemeComponent, table_sha256: String, sources: List(GraphemeSource), )
pub type IndicProperty {
IndicOther
Consonant
IndicExtend
Linker
}
Constructors
-
IndicOther -
Consonant -
IndicExtend -
Linker
pub type IndicRange {
IndicRange(first: Int, last: Int, property: IndicProperty)
}
Constructors
-
IndicRange(first: Int, last: Int, property: IndicProperty)
pub type IntegerDomain {
Unbounded
IntegerInterval(minimum: Int, maximum: Int)
}
Constructors
-
Unbounded -
IntegerInterval(minimum: Int, maximum: Int)
pub type IntegerDomainBinding {
IntegerDomainBinding(
name: String,
reference: ProfileRef,
range: IntegerDomain,
forms: List(IntegerForm),
)
}
Constructors
-
IntegerDomainBinding( name: String, reference: ProfileRef, range: IntegerDomain, forms: List(IntegerForm), )
pub type IntegerForm {
Number
IntegralDecimal
DecimalString
}
Constructors
-
Number -
IntegralDecimal -
DecimalString
pub type IntegerSpec {
IntegerSpec(
domain: option.Option(String),
minimum: option.Option(Int),
maximum: option.Option(Int),
const_value: option.Option(Int),
enum_values: option.Option(List(Int)),
default_value: option.Option(Int),
)
}
Constructors
-
IntegerSpec( domain: option.Option(String), minimum: option.Option(Int), maximum: option.Option(Int), const_value: option.Option(Int), enum_values: option.Option(List(Int)), default_value: option.Option(Int), )
pub type JsonValue =
exact_json.JsonValue
pub type LengthBound {
LengthBound(
unit: StringLengthUnit,
minimum: option.Option(Int),
maximum: option.Option(Int),
)
}
Constructors
-
LengthBound( unit: StringLengthUnit, minimum: option.Option(Int), maximum: option.Option(Int), )
pub type LengthSpec {
LengthSpec(
minimum: option.Option(Int),
maximum: option.Option(Int),
)
}
Constructors
-
LengthSpec( minimum: option.Option(Int), maximum: option.Option(Int), )
pub type MeaningFailure {
MeaningFailure(
type_ref: TypeRef,
predicate: MeaningObligation,
location: List(String),
)
}
Constructors
-
MeaningFailure( type_ref: TypeRef, predicate: MeaningObligation, location: List(String), )
pub type MeaningObligation {
Mo01
Mo02
Mo03
Mo04
Mo05
Mo06
Mo07
Mo08
Mo09
Mo10
Mo11
}
Constructors
-
Mo01 -
Mo02 -
Mo03 -
Mo04 -
Mo05 -
Mo06 -
Mo07 -
Mo08 -
Mo09 -
Mo10 -
Mo11
pub type MemberTest {
AbsentMember
FormatMember(name: String)
}
Constructors
-
AbsentMember -
FormatMember(name: String)
pub type NumberModel {
NumberModel(decimals: Bool)
}
Constructors
-
NumberModel(decimals: Bool)
pub type ObjectClass {
SealedObject(form: SealedForm)
WrapperObject(wrapper: Wrapper)
OrdinaryObjectClass
}
Constructors
-
SealedObject(form: SealedForm) -
WrapperObject(wrapper: Wrapper) -
OrdinaryObjectClass
pub type Origin {
Origin(source: SourceIdentity, locator: List(String))
}
Constructors
-
Origin(source: SourceIdentity, locator: List(String))
pub type PathStep {
Field(name: String)
Index(index: Int)
Variant(tag: String)
}
Constructors
-
Field(name: String) -
Index(index: Int) -
Variant(tag: String)
pub type ProductSpec {
ProductSpec(fields: List(FieldSpec), extras: ExtraMembers)
}
Constructors
-
ProductSpec(fields: List(FieldSpec), extras: ExtraMembers)
pub type ProfileFailure {
ProfileFailure(
reference: ProfileRef,
predicate: ProfilePredicate,
location: List(String),
)
}
Constructors
-
ProfileFailure( reference: ProfileRef, predicate: ProfilePredicate, location: List(String), )
pub type ProfilePredicate {
Pr01
Pr02
Pr03
Pr04
Pr05
Pr06
Pr07
Pr08
Pr09
Pr10
Pr11
Pr12
Pr13
Pr14
Pr15
Pr16
}
Constructors
-
Pr01 -
Pr02 -
Pr03 -
Pr04 -
Pr05 -
Pr06 -
Pr07 -
Pr08 -
Pr09 -
Pr10 -
Pr11 -
Pr12 -
Pr13 -
Pr14 -
Pr15 -
Pr16
pub type ProfileRef {
ProfileRef(
identity: String,
revision: String,
content_digest: String,
)
}
Constructors
-
ProfileRef( identity: String, revision: String, content_digest: String, )
pub type SealedExtras {
SealedReject
SealedAny
}
Constructors
-
SealedReject -
SealedAny
pub type SealedField {
SealedField(key: String, required: Bool, leaf: SealedLeaf)
}
Constructors
-
SealedField(key: String, required: Bool, leaf: SealedLeaf)
pub type SealedForm {
SealedForm(
tag: String,
fields: List(SealedField),
extras: SealedExtras,
)
}
Constructors
-
SealedForm( tag: String, fields: List(SealedField), extras: SealedExtras, )
pub type SealedLeaf {
SealedString(spec: StringSpec)
SealedInteger(spec: IntegerSpec)
}
Constructors
-
SealedString(spec: StringSpec) -
SealedInteger(spec: IntegerSpec)
pub type SealedRefinement {
SealedRefinement(key: String, leaf: SealedLeaf)
}
Constructors
-
SealedRefinement(key: String, leaf: SealedLeaf)
pub type SemanticGraph {
SemanticGraph(
profile: SemanticProfile,
nodes: List(TypeNode),
source_refs: List(SourceRef),
)
}
Constructors
-
SemanticGraph( profile: SemanticProfile, nodes: List(TypeNode), source_refs: List(SourceRef), )
pub type SemanticObligation {
SemanticObligation(
type_ref: TypeRef,
value_path: List(PathStep),
reason: SemanticReason,
)
}
Constructors
-
SemanticObligation( type_ref: TypeRef, value_path: List(PathStep), reason: SemanticReason, )
pub type SemanticProfile {
SemanticProfile(
reference: ProfileRef,
source_refs: List(SourceIdentity),
integer_domains: List(IntegerDomainBinding),
default_integer_domain: String,
numbers: NumberModel,
grapheme_rules: option.Option(GraphemeRules),
format_bindings: List(FormatBinding),
bytes_policy: option.Option(BytesPolicy),
wrappers: List(Wrapper),
tag: option.Option(TagModel),
)
}
Constructors
-
SemanticProfile( reference: ProfileRef, source_refs: List(SourceIdentity), integer_domains: List(IntegerDomainBinding), default_integer_domain: String, numbers: NumberModel, grapheme_rules: option.Option(GraphemeRules), format_bindings: List(FormatBinding), bytes_policy: option.Option(BytesPolicy), wrappers: List(Wrapper), tag: option.Option(TagModel), )
pub type SemanticReason {
UnknownFormatReason(name: String)
MissingGraphemeRulesReason
MissingBytesPolicyReason
UnknownIntegerDomainReason(name: String)
UnknownWrapperReason(name: String)
WrapperPayloadReason(name: String)
UnknownSealedTagReason(tag: String)
DecimalNotAdmittedReason
IntegerBoundReason
OpaqueTypeReason(name: String)
MissingTagModelReason
UnresolvedTypeReason
MembershipBoundReason
}
Constructors
-
UnknownFormatReason(name: String) -
MissingGraphemeRulesReason -
MissingBytesPolicyReason -
UnknownIntegerDomainReason(name: String) -
UnknownWrapperReason(name: String) -
WrapperPayloadReason(name: String) -
UnknownSealedTagReason(tag: String) -
DecimalNotAdmittedReason -
IntegerBoundReason -
OpaqueTypeReason(name: String) -
MissingTagModelReason -
UnresolvedTypeReason -
MembershipBoundReason
pub type SlotValue(a) {
Absent
Null
Present(a)
}
Constructors
-
Absent -
Null -
Present(a)
pub type SourceIdentity {
SourceIdentity(
repository: String,
revision: String,
path: String,
content_digest: String,
)
}
Constructors
-
SourceIdentity( repository: String, revision: String, path: String, content_digest: String, )
pub type SourceRef {
SourceRef(
repository: String,
revision: String,
path: String,
content_digest: String,
document_id: String,
declared_revision: option.Option(Int),
)
}
Constructors
-
SourceRef( repository: String, revision: String, path: String, content_digest: String, document_id: String, declared_revision: option.Option(Int), )
pub type StringLengthUnit {
Utf8Bytes
UnicodeScalars
Graphemes
}
Constructors
-
Utf8Bytes -
UnicodeScalars -
Graphemes
pub type StringSpec {
StringSpec(
format: option.Option(FormatUse),
lengths: List(LengthBound),
wrapper: option.Option(String),
const_value: option.Option(String),
enum_values: option.Option(List(String)),
examples: List(String),
default_value: option.Option(String),
)
}
Constructors
-
StringSpec( format: option.Option(FormatUse), lengths: List(LengthBound), wrapper: option.Option(String), const_value: option.Option(String), enum_values: option.Option(List(String)), examples: List(String), default_value: option.Option(String), )
pub type TagModel {
TagModel(
key: String,
format: option.Option(String),
sealed: List(SealedForm),
)
}
Constructors
-
TagModel( key: String, format: option.Option(String), sealed: List(SealedForm), )
pub type TypeNode {
TypeNode(
reference: TypeRef,
shape: TypeShape,
description: option.Option(String),
attributes: List(OccurrenceRef),
extensions: List(OccurrenceRef),
)
}
Constructors
-
TypeNode( reference: TypeRef, shape: TypeShape, description: option.Option(String), attributes: List(OccurrenceRef), extensions: List(OccurrenceRef), )
pub type TypeShape {
BooleanShape(spec: BooleanSpec)
IntegerShape(spec: IntegerSpec)
DecimalShape(spec: DecimalSpec)
StringShape(spec: StringSpec)
BytesShape(spec: LengthSpec)
ProductShape(spec: ProductSpec)
ArrayShape(spec: ArraySpec)
AliasShape(target: TypeRef, reference_text: String)
TaggedUnionShape(spec: UnionSpec)
SealedShape(tag: String, refinements: List(SealedRefinement))
Never
UnknownShape(kind: UnknownKind)
UnitShape
RawBodyShape(encoding: String)
OpaqueShape(type_name: String)
}
Constructors
-
BooleanShape(spec: BooleanSpec) -
IntegerShape(spec: IntegerSpec) -
DecimalShape(spec: DecimalSpec) -
StringShape(spec: StringSpec) -
BytesShape(spec: LengthSpec) -
ProductShape(spec: ProductSpec) -
ArrayShape(spec: ArraySpec) -
AliasShape(target: TypeRef, reference_text: String) -
TaggedUnionShape(spec: UnionSpec) -
SealedShape(tag: String, refinements: List(SealedRefinement)) -
Never -
UnknownShape(kind: UnknownKind) -
UnitShape -
RawBodyShape(encoding: String) -
OpaqueShape(type_name: String)
pub type UnionBranch {
UnionBranch(
target: TypeRef,
wire_tag: String,
selector: BranchSelector,
origin: OccurrenceRef,
)
}
Constructors
-
UnionBranch( target: TypeRef, wire_tag: String, selector: BranchSelector, origin: OccurrenceRef, )
pub type UnionSpec {
UnionSpec(branches: List(UnionBranch))
}
Constructors
-
UnionSpec(branches: List(UnionBranch))
pub type UnknownKind {
AnyValue
OrdinaryObject
}
Constructors
-
AnyValue -
OrdinaryObject
pub type ValueCondition {
MissingRequiredCondition
NullNotAllowedCondition
WrongValueKindCondition(expected: String)
ConstMismatchCondition
EnumMismatchCondition
BelowMinimumCondition
AboveMaximumCondition
IntegerDomainCondition
StringLengthCondition
ArrayLengthCondition
BytesLengthCondition
FormatFailureCondition(name: String)
InvalidBytesCondition
InvalidWrapperCondition(name: String)
InvalidTagCondition
ReservedFormCondition
NoBranchSelectedCondition
KeyFormatCondition(name: String)
UninhabitedCondition
DuplicateFieldCondition(name: String)
UnexpectedFieldCondition(name: String)
InvalidDataModelCondition
ReferenceCycleCondition
}
Constructors
-
MissingRequiredCondition -
NullNotAllowedCondition -
WrongValueKindCondition(expected: String) -
ConstMismatchCondition -
EnumMismatchCondition -
BelowMinimumCondition -
AboveMaximumCondition -
IntegerDomainCondition -
StringLengthCondition -
ArrayLengthCondition -
BytesLengthCondition -
FormatFailureCondition(name: String) -
InvalidBytesCondition -
InvalidWrapperCondition(name: String) -
InvalidTagCondition -
ReservedFormCondition -
NoBranchSelectedCondition -
KeyFormatCondition(name: String) -
UninhabitedCondition -
DuplicateFieldCondition(name: String) -
UnexpectedFieldCondition(name: String) -
InvalidDataModelCondition -
ReferenceCycleCondition
pub type ValueDecision {
AcceptedValue
RejectedValue(failure: ValueFailure)
UnresolvedValue(obligations: List(SemanticObligation))
CertificateMismatchValue(condition: String)
}
Constructors
-
AcceptedValue -
RejectedValue(failure: ValueFailure) -
UnresolvedValue(obligations: List(SemanticObligation)) -
CertificateMismatchValue(condition: String)
pub type ValueFailure {
ValueFailure(
type_ref: TypeRef,
definition_ref: DefinitionRef,
origin: OccurrenceRef,
value_path: List(PathStep),
condition: ValueCondition,
observed: SlotValue(exact_json.JsonValue),
reference_trace: List(TypeRef),
)
}
Constructors
-
ValueFailure( type_ref: TypeRef, definition_ref: DefinitionRef, origin: OccurrenceRef, value_path: List(PathStep), condition: ValueCondition, observed: SlotValue(exact_json.JsonValue), reference_trace: List(TypeRef), )
pub type ValueKind {
NullKind
BooleanKind
NumberKind
StringKind
ArrayKind
ObjectKind
}
Constructors
-
NullKind -
BooleanKind -
NumberKind -
StringKind -
ArrayKind -
ObjectKind
pub type Wrapper {
Wrapper(name: String, key: String, payload: WrapperPayload)
}
Constructors
-
Wrapper(name: String, key: String, payload: WrapperPayload)
pub type WrapperPayload {
WrapperBytes
WrapperText(format: option.Option(String))
}
Constructors
-
WrapperBytes -
WrapperText(format: option.Option(String))
Values
pub fn checked_profile(
profile: SemanticProfile,
) -> CheckedProfile
pub fn checked_profile_value(
checked: CheckedProfile,
) -> SemanticProfile
pub fn occurrence(reference: TypeRef) -> OccurrenceRef
pub fn occurrence_at(
reference: TypeRef,
name: String,
) -> OccurrenceRef