necoherence/semantic_types

Types

pub type ArraySpec {
  ArraySpec(
    item: ElementContract,
    min_length: option.Option(Int),
    max_length: option.Option(Int),
  )
}

Constructors

pub type BooleanSpec {
  BooleanSpec(
    const_value: option.Option(Bool),
    default_value: option.Option(Bool),
  )
}

Constructors

pub type BranchSelector {
  InternalTag
  MemberShape(tests: List(#(String, MemberTest)))
  Kind(kind: ValueKind)
  Otherwise
}

Constructors

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

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,
    )
pub 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

pub type DefinitionRef {
  DefinitionRef(source: SourceRef, name: String)
}

Constructors

  • DefinitionRef(source: SourceRef, name: String)
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 ElementContract {
  ElementContract(type_ref: TypeRef, nullable: Bool)
}

Constructors

  • ElementContract(type_ref: TypeRef, nullable: Bool)
pub type ExtraMembers {
  RejectExtras
  AllowExtras(
    key_format: option.Option(FormatUse),
    value: ElementContract,
  )
}

Constructors

pub type FieldSpec {
  FieldSpec(
    wire_name: String,
    slot: SlotContract,
    origin: OccurrenceRef,
  )
}

Constructors

pub type FormatBinding {
  FormatBinding(
    name: String,
    reference: ProfileRef,
    rule: FormatRule,
  )
}

Constructors

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

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

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

pub type GraphemeSource {
  GraphemeSource(role: String, origin: Origin)
}

Constructors

  • GraphemeSource(role: String, origin: Origin)
pub type IndicProperty {
  IndicOther
  Consonant
  IndicExtend
  Linker
}

Constructors

  • IndicOther
  • Consonant
  • IndicExtend
  • Linker
pub type IndicRange {
  IndicRange(first: Int, last: Int, property: IndicProperty)
}

Constructors

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

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

pub type JsonValue =
  exact_json.JsonValue
pub type LengthBound {
  LengthBound(
    unit: StringLengthUnit,
    minimum: option.Option(Int),
    maximum: option.Option(Int),
  )
}

Constructors

pub type LengthSpec {
  LengthSpec(
    minimum: option.Option(Int),
    maximum: option.Option(Int),
  )
}

Constructors

pub type MeaningFailure {
  MeaningFailure(
    type_ref: TypeRef,
    predicate: MeaningObligation,
    location: List(String),
  )
}

Constructors

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

pub type OccurrenceRef {
  OccurrenceRef(source: SourceRef, pointer: List(String))
}

Constructors

  • OccurrenceRef(source: SourceRef, pointer: List(String))
pub type Origin {
  Origin(source: SourceIdentity, locator: List(String))
}

Constructors

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

pub type ProfileFailure {
  ProfileFailure(
    reference: ProfileRef,
    predicate: ProfilePredicate,
    location: List(String),
  )
}

Constructors

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

pub type SealedLeaf {
  SealedString(spec: StringSpec)
  SealedInteger(spec: IntegerSpec)
}

Constructors

pub type SealedRefinement {
  SealedRefinement(key: String, leaf: SealedLeaf)
}

Constructors

pub type SemanticGraph {
  SemanticGraph(
    profile: SemanticProfile,
    nodes: List(TypeNode),
    source_refs: List(SourceRef),
  )
}

Constructors

pub type SemanticObligation {
  SemanticObligation(
    type_ref: TypeRef,
    value_path: List(PathStep),
    reason: SemanticReason,
  )
}

Constructors

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

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 SlotContract {
  SlotContract(type_ref: TypeRef, required: Bool, nullable: Bool)
}

Constructors

  • SlotContract(type_ref: TypeRef, required: Bool, nullable: Bool)
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

pub type TagModel {
  TagModel(
    key: String,
    format: option.Option(String),
    sealed: List(SealedForm),
  )
}

Constructors

pub type TypeNode {
  TypeNode(
    reference: TypeRef,
    shape: TypeShape,
    description: option.Option(String),
    attributes: List(OccurrenceRef),
    extensions: List(OccurrenceRef),
  )
}

Constructors

pub type TypeRef {
  TypeRef(
    source: SourceRef,
    definition_name: String,
    pointer: List(String),
  )
}

Constructors

  • TypeRef(
      source: SourceRef,
      definition_name: String,
      pointer: List(String),
    )
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

pub type UnionBranch {
  UnionBranch(
    target: TypeRef,
    wire_tag: String,
    selector: BranchSelector,
    origin: OccurrenceRef,
  )
}

Constructors

pub type UnionSpec {
  UnionSpec(branches: List(UnionBranch))
}

Constructors

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

pub type ValueKind {
  NullKind
  BooleanKind
  NumberKind
  StringKind
  ArrayKind
  ObjectKind
}

Constructors

  • NullKind
  • BooleanKind
  • NumberKind
  • StringKind
  • ArrayKind
  • ObjectKind
pub type ValuePath =
  List(PathStep)
pub type Wrapper {
  Wrapper(name: String, key: String, payload: WrapperPayload)
}

Constructors

pub type WrapperPayload {
  WrapperBytes
  WrapperText(format: option.Option(String))
}

Constructors

Values

pub fn checked_profile(
  profile: SemanticProfile,
) -> CheckedProfile
pub fn checked_profile_value(
  checked: CheckedProfile,
) -> SemanticProfile
pub fn child(
  reference: TypeRef,
  segments: List(String),
) -> TypeRef
pub fn occurrence(reference: TypeRef) -> OccurrenceRef
pub fn occurrence_at(
  reference: TypeRef,
  name: String,
) -> OccurrenceRef
✨ Search Document