#[repr(C)]pub struct HopperSchemaPointer {
pub schema_version: u16,
pub pointer_flags: u16,
pub manifest_hash: [u8; 32],
pub idl_hash: [u8; 32],
pub codama_hash: [u8; 32],
pub uri_len: u16,
pub uri: [u8; 192],
}Expand description
On-chain account that points to a Hopper program’s schema.
Stored at PDA ["hopper-schema", program_id]. Contains hashes of
the manifest, IDL, and Codama projection, plus a URI to fetch the
full manifest. See docs/ONCHAIN_SCHEMA_PUBLICATION.md.
§Wire layout (294 bytes payload + 16 bytes header = 310 bytes)
[0..16] Hopper header (disc=255, ver=1)
[16..18] schema_version u16 LE
[18..20] pointer_flags u16 LE
[20..52] manifest_hash [u8; 32]
[52..84] idl_hash [u8; 32]
[84..116] codama_hash [u8; 32]
[116..118] uri_len u16 LE
[118..310] uri [u8; 192]Fields§
§schema_version: u16Schema format version (currently 1).
pointer_flags: u16Feature flags (HAS_MANIFEST, HAS_IDL, HAS_CODAMA, HAS_URI, …).
manifest_hash: [u8; 32]SHA-256 of the manifest JSON.
idl_hash: [u8; 32]SHA-256 of the IDL JSON.
codama_hash: [u8; 32]SHA-256 of the Codama projection JSON.
uri_len: u16Length of the URI string (0..192).
uri: [u8; 192]UTF-8 URI pointing to the manifest (padded with zeros).
Implementations§
Source§impl HopperSchemaPointer
impl HopperSchemaPointer
Sourcepub const PAYLOAD_LEN: usize
pub const PAYLOAD_LEN: usize
Total payload size (excluding Hopper header).
Sourcepub const ACCOUNT_LEN: usize
pub const ACCOUNT_LEN: usize
Total account size including Hopper header.
pub const FLAG_HAS_MANIFEST: u16 = 0x0001
pub const FLAG_HAS_IDL: u16 = 0x0002
pub const FLAG_HAS_CODAMA: u16 = 0x0004
pub const FLAG_HAS_URI: u16 = 0x0008
pub const FLAG_URI_IS_IPFS: u16 = 0x0010
pub const FLAG_URI_IS_ARWEAVE: u16 = 0x0020
Trait Implementations§
Source§impl Clone for HopperSchemaPointer
impl Clone for HopperSchemaPointer
Source§fn clone(&self) -> HopperSchemaPointer
fn clone(&self) -> HopperSchemaPointer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HopperSchemaPointer
Auto Trait Implementations§
impl Freeze for HopperSchemaPointer
impl RefUnwindSafe for HopperSchemaPointer
impl Send for HopperSchemaPointer
impl Sync for HopperSchemaPointer
impl Unpin for HopperSchemaPointer
impl UnsafeUnpin for HopperSchemaPointer
impl UnwindSafe for HopperSchemaPointer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more