Skip to main content

Crate opys_core

Crate opys_core 

Source
Expand description

@opys/core — manifest data model, shorthand, Val/Valset, glob, interpolation. Reference implementation of the frozen opys.json wire format. Mirrors the TS package one-to-one.

Depends on opys-mojang-rules for the rule format/evaluator.

Structs§

Artifact
ArtifactWire
ConditionalVal
Discovery
ExtractDump
ExtractPick
ExtractScan
IntegrityProbes
Launch
LaunchWire
Manifest
ManifestWire
OsConstraint
Constraint on OS as it appears in rule JSON. Every field is optional and independent — present must match, absent is ignored.
OsOptions
Platform context passed to rule evaluation. Free-form strings — these are live OS detection values, not constrained by the wire schema.
PointerDescriptor
PointerDescriptorWire
SizeProbes
Val

Enums§

DecodeError
ExtractRule
A single extract rule, discriminated structurally on the wire (which field is present: file → Pick, matches → Scan, otherwise Dump).
ExtractWire
Wire form: one rule or many. Decoding flattens both into Vec<ExtractRule>; encoding emits the bare object when the list has exactly one entry.
HashAlgo
HashEntry
HashRef
Where a discovered hash sits, keyed by algorithm. The string is a location (header name or URL), not the hash itself.
Integrity
One entry, multiple entries, or omitted (= skip verification).
OsArch
OsName
RawRuleset
Wire form of a ruleset: a single entry or an array.
RawSingle
Wire form of a single rule entry: either a shorthand string or an expanded rule object.
Rule
A rule is { action } plus an optional os or features constraint.
RuleAction
RuleError
ShorthandError
Source
SourceWire
Wire shape — discriminated by which field is present, NOT by a kind tag.
ValDef

Functions§

allow_os_ruleset
artifact_applies
Free-fn alias for Artifact::applies — kept until callers migrate.
decode_artifact
decode_extract
decode_launch
decode_manifest
decode_pointer_descriptor
decode_source
deduplicate_artifacts
Deduplicate by normalized path — later entries win.
empty_ruleset
encode_artifact
encode_extract
encode_launch
encode_manifest
encode_pointer_descriptor
encode_short_rule
encode_short_ruleset
encode_source
encode_val
encode_val_defs
encode_valset
filter_manifest
glob_base
Longest non-glob prefix, truncated to the last /.
glob_to_regex
Compile a glob to an anchored Regex. Pattern source is ^…$.
interpolate
Substitute resolved vars into template. Missing names stay as ${name}.
parse_manifest
parse_pointer_descriptor
parse_short_rule
parse_short_ruleset
parse_val
parse_val_defs
parse_valset
resolve_val_defs
For each key: flat → use as-is; arms → last matching arm wins.
resolve_valset
resolve_vars
Resolve every ${ref} in vars. Circular references throw.
resolved_args
resolved_envs
satisfies_features
satisfies_os
satisfies_rule
satisfies_ruleset

Type Aliases§

FeatureConstraint
Feature constraint: { feature_name: required_value }. A feature is “satisfied” iff its presence in the active set matches the required bool.
Ruleset
ValDefs
Valset
VarMap