pub trait SchemaExport: LayoutContract {
// Required method
fn layout_manifest() -> LayoutManifest;
// Provided methods
fn layout_info() -> LayoutInfo { ... }
fn field_map() -> &'static [FieldInfo] { ... }
fn manager_metadata() -> ManagerMetadata { ... }
fn schema_bundle() -> SchemaBundle { ... }
}Expand description
Trait for layout types that can export their full schema information.
This creates a single source of truth linking runtime layout contracts (discriminator, version, layout_id, size) with field-level metadata (names, offsets, sizes). The exported information powers:
- Manager metadata (on-chain or off-chain program inspection)
- IDL generation (Codama, Hopper IDL, client SDKs)
- Schema diff and migration safety checking
- Client code generation with typed field access
Implementors provide both a runtime-facing view (layout_info, field_map)
and a higher-level schema manifest for richer tooling.
Required Methods§
Sourcefn layout_manifest() -> LayoutManifest
fn layout_manifest() -> LayoutManifest
Rich schema manifest for diffing, linting, and client generation.
Provided Methods§
Sourcefn layout_info() -> LayoutInfo
fn layout_info() -> LayoutInfo
Runtime header/layout identity.
Sourcefn field_map() -> &'static [FieldInfo]
fn field_map() -> &'static [FieldInfo]
Field-level wire map used by manager and client tooling.
Sourcefn manager_metadata() -> ManagerMetadata
fn manager_metadata() -> ManagerMetadata
Combined runtime metadata payload for manager-facing inspection.
Sourcefn schema_bundle() -> SchemaBundle
fn schema_bundle() -> SchemaBundle
Combined runtime and manifest metadata payload.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.