pub struct ProgramManifest {
pub name: &'static str,
pub version: &'static str,
pub description: &'static str,
pub layouts: &'static [LayoutManifest],
pub layout_metadata: &'static [LayoutMetadata],
pub instructions: &'static [InstructionDescriptor],
pub events: &'static [EventDescriptor],
pub policies: &'static [PolicyDescriptor],
pub compatibility_pairs: &'static [CompatibilityPair],
pub tooling_hints: &'static [&'static str],
pub contexts: &'static [ContextDescriptor],
}Expand description
A full program manifest for Hopper Manager and tooling.
This is the rich internal schema that powers hopper manager,
compatibility checking, migration planning, receipt rendering, and
CLI inspection. It is intentionally richer than the public IDL –
the manifest carries operational metadata that tools need but
external consumers do not.
§Truth hierarchy
ProgramManifest ⊃ ProgramIdl ⊃ CodamaProjection
(rich) (public) (interop)Fields§
§name: &'static strProgram name.
version: &'static strProgram version string.
description: &'static strProgram description.
layouts: &'static [LayoutManifest]Layout manifests for all account types.
layout_metadata: &'static [LayoutMetadata]Extended per-layout operational metadata.
instructions: &'static [InstructionDescriptor]Instruction descriptors.
events: &'static [EventDescriptor]Event descriptors.
policies: &'static [PolicyDescriptor]Policy descriptors.
compatibility_pairs: &'static [CompatibilityPair]Known upgrade paths between layout versions.
tooling_hints: &'static [&'static str]Tooling / rendering hints for Manager.
contexts: &'static [ContextDescriptor]Context (instruction account struct) descriptors.
Implementations§
Source§impl ProgramManifest
impl ProgramManifest
Sourcepub const fn layout_count(&self) -> usize
pub const fn layout_count(&self) -> usize
Number of layouts.
Sourcepub const fn instruction_count(&self) -> usize
pub const fn instruction_count(&self) -> usize
Number of instructions.
Sourcepub fn find_layout_by_disc(&self, disc: u8) -> Option<&LayoutManifest>
pub fn find_layout_by_disc(&self, disc: u8) -> Option<&LayoutManifest>
Find a layout by discriminator.
Sourcepub fn find_layout_by_id(&self, layout_id: &[u8; 8]) -> Option<&LayoutManifest>
pub fn find_layout_by_id(&self, layout_id: &[u8; 8]) -> Option<&LayoutManifest>
Find a layout by layout_id fingerprint.
Sourcepub fn identify_from_data(&self, data: &[u8]) -> Option<&LayoutManifest>
pub fn identify_from_data(&self, data: &[u8]) -> Option<&LayoutManifest>
Find a layout that matches the given account data header.
Sourcepub fn find_instruction(&self, tag: u8) -> Option<&InstructionDescriptor>
pub fn find_instruction(&self, tag: u8) -> Option<&InstructionDescriptor>
Find an instruction by tag.
Sourcepub fn find_policy(&self, name: &str) -> Option<&PolicyDescriptor>
pub fn find_policy(&self, name: &str) -> Option<&PolicyDescriptor>
Find a policy by name.
Sourcepub fn find_layout_metadata(&self, name: &str) -> Option<&LayoutMetadata>
pub fn find_layout_metadata(&self, name: &str) -> Option<&LayoutMetadata>
Find extended layout metadata by layout name.
Sourcepub fn find_compat_pair(
&self,
from_name: &str,
from_ver: u8,
to_name: &str,
to_ver: u8,
) -> Option<&CompatibilityPair>
pub fn find_compat_pair( &self, from_name: &str, from_ver: u8, to_name: &str, to_ver: u8, ) -> Option<&CompatibilityPair>
Find a compatibility pair for an upgrade path.
Trait Implementations§
Source§impl Clone for ProgramManifest
impl Clone for ProgramManifest
Source§fn clone(&self) -> ProgramManifest
fn clone(&self) -> ProgramManifest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more