Skip to main content

ProgramManifest

Struct ProgramManifest 

Source
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 str

Program name.

§version: &'static str

Program version string.

§description: &'static str

Program 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

Source

pub const fn empty() -> Self

Create an empty program manifest.

Source

pub const fn layout_count(&self) -> usize

Number of layouts.

Source

pub const fn instruction_count(&self) -> usize

Number of instructions.

Source

pub fn find_layout_by_disc(&self, disc: u8) -> Option<&LayoutManifest>

Find a layout by discriminator.

Source

pub fn find_layout_by_id(&self, layout_id: &[u8; 8]) -> Option<&LayoutManifest>

Find a layout by layout_id fingerprint.

Source

pub fn identify_from_data(&self, data: &[u8]) -> Option<&LayoutManifest>

Find a layout that matches the given account data header.

Source

pub fn find_instruction(&self, tag: u8) -> Option<&InstructionDescriptor>

Find an instruction by tag.

Source

pub fn find_policy(&self, name: &str) -> Option<&PolicyDescriptor>

Find a policy by name.

Source

pub fn find_layout_metadata(&self, name: &str) -> Option<&LayoutMetadata>

Find extended layout metadata by layout name.

Source

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

Source§

fn clone(&self) -> ProgramManifest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Display for ProgramManifest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for ProgramManifest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.