Skip to main content

Crate hopper_schema

Crate hopper_schema 

Source
Expand description

§Hopper Schema

Schema export, ABI fingerprinting, decode tooling, and program management primitives for the Hopper framework.

Provides:

  • Layout manifest generation (JSON-compatible metadata)
  • Layout fingerprint computation and comparison
  • Schema diff detection for migration safety
  • Field-level compatibility checking
  • Account header decoding and inspection
  • Segment registry inspection
  • Manifest registries for multi-layout programs
  • Program manifests for Hopper Manager (full program schema)
  • Field-level account decoding for account inspection
  • Segment migration analysis and migration planning

Modules§

accounts
Context-level schema metadata for the Account DSL.
anchor_idl
Anchor IDL Emitter
clientgen
Client Generation Module
codama
Codama Projection Module
python_client
Python client emitter
rust_client
Rust client generator.

Structs§

AccountEntry
An account entry in an instruction’s account list.
ArgDescriptor
An argument descriptor for an instruction.
CodamaAccount
Codama-compatible account descriptor.
CodamaEvent
Codama-compatible event descriptor.
CodamaInstruction
Codama-compatible instruction descriptor.
CodamaProjection
Codama-compatible projection of a Hopper program.
CompatibilityExplain
A structured, human-readable explanation of a compatibility verdict.
CompatibilityPair
A compatibility pair describing a known upgrade path.
ConstantDescriptor
Public-facing program constant.
DecodedField
A decoded field value from account data.
DecodedHeader
Decoded account header for inspection/tooling.
DecodedReceipt
Decoded receipt from wire bytes. Useful for CLI and off-chain tooling.
DecodedSegment
Decoded segment entry for inspection.
ErrorDescriptor
Descriptor for one variant of a #[hopper::error] enum.
ErrorRegistry
A convenience wrapper holding an enum’s full error table.
EventDescriptor
An event descriptor in a program manifest.
FieldCompatEntry
A single field compatibility entry.
FieldCompatReport
Result of a field-level compatibility comparison.
FieldDescriptor
A field descriptor in a layout manifest.
HopperIdl
Extended IDL with full Hopper-native sections.
HopperSchemaPointer
On-chain account that points to a Hopper program’s schema.
IdlAccountEntry
IDL account entry with optional PDA metadata.
IdlInstructionDescriptor
IDL instruction descriptor.
IdlSegmentDescriptor
Segment metadata for inclusion in the IDL.
InstructionDescriptor
An instruction descriptor in a program manifest.
LayoutBehavior
Describes how a layout behaves under mutation, what policy it expects, and what receipt profile it should produce.
LayoutFingerprint
Extended layout fingerprint combining wire-level and semantic identity.
LayoutManifest
A layout manifest describing an account type.
LayoutMetadata
Extended per-layout metadata for the manifest.
ManagerMetadata
Minimal manager-readable metadata for a Hopper layout.
ManifestRegistry
A static registry of all layout manifests for a program.
MigrationPlan
A generated migration plan between two layout versions.
MigrationStep
A step in the migration plan.
OperatingProfile
A machine-readable summary of a program’s operational characteristics.
PdaSeedHint
PDA seed hint for an instruction account.
PolicyDescriptor
A policy descriptor in a program manifest.
ProgramIdl
A public-facing IDL for a Hopper program.
ProgramManifest
A full program manifest for Hopper Manager and tooling.
ReceiptExplain
Human-readable explanation of a decoded receipt.
ReceiptNarrative
An auto-generated human-readable narrative describing a mutation.
ReceiptProfile
A receipt profile describing what a receipt for a given mutation type looks like.
SchemaBundle
Unified schema payload tying runtime identity to rich manifest metadata.
SegmentAdvice
Migration advice for a single segment.
SegmentMap
A decoded segment map for display.
SegmentMigrationReport
Segment-level migration report for a segmented account.
SemanticLint
A semantic lint warning produced by analyzing field intents, mutation classes, and policy against a layout manifest.

Enums§

ArgParseError
Failure reason for #[hopper::args] T::parse.
CompatImpact
Compatibility impact level encoded in a receipt.
CompatibilityVerdict
Unified compatibility verdict between two layout versions.
FieldCompat
Field-level compatibility result.
FieldIntent
Semantic intent of a layout field.
LayoutStabilityGrade
How safe it is to evolve a layout over time.
LintSeverity
Lint severity.
MigrationAction
Migration action type.
MigrationPolicy
Migration policy for a version transition.
MutationClass
Classification of how a layout or segment behaves when mutated.
NarrativeRisk
Risk level for a receipt narrative.
Phase
Instruction execution phase encoded in a receipt.
PolicyClass
High-level classification of what a policy governs.
SegmentRoleHint
Segment role classification for migration (mirrors hopper-core SegmentRole).

Constants§

MANIFEST_COMPRESS_NONE
Compression tag: no compression (raw JSON).
MANIFEST_COMPRESS_ZLIB
Compression tag: zlib-deflate compressed JSON.
MANIFEST_HEADER_LEN
On-chain manifest account header size (bytes).
MANIFEST_MAGIC
8-byte magic discriminator at the start of a manifest account.
MANIFEST_SEED
PDA seed for on-chain Hopper manifest accounts.
MANIFEST_VERSION
Current manifest wire format version.

Traits§

AccountSchemaExt
Bridge from a live AccountView to the schema bundle of a concrete layout type.
SchemaExport
Trait for layout types that can export their full schema information.

Functions§

compare_fields
Compare two manifests field-by-field.
decode_account_fields
Decode all fields of an account against a layout manifest.
decode_header
Decode an account header from raw bytes.
decode_segments
Decode segment entries from a segmented account.
format_header
Decode an account header and format it for display.
format_segment_map
Decode segments and return a displayable segment map string.
identify_account
Try to identify which manifest matches an account’s header.
is_append_compatible
Check if two layout manifests are append-compatible.
is_backward_readable
Check if accounts written by newer can still be parsed by code expecting older.
lint_layout
Run semantic lints against a layout manifest and its behavior.
lint_policy
Run policy-aware semantic lints.
requires_migration
Check if migration is required between two manifests.