pub struct ContextDescriptor {
pub name: &'static str,
pub accounts: &'static [ContextAccountDescriptor],
pub policies: &'static [&'static str],
pub receipts_expected: bool,
pub mutation_classes: &'static [&'static str],
}Expand description
Schema descriptor for an entire instruction context (account struct).
Captures the full Account DSL metadata for a single instruction’s account requirements. Used for explain output, schema comparison, and manifest inclusion.
Fields§
§name: &'static strContext struct name (e.g. “Deposit”, “Withdraw”).
accounts: &'static [ContextAccountDescriptor]Per-account field descriptors.
policies: &'static [&'static str]Policy pack names used by this context.
receipts_expected: boolWhether receipts are expected from this instruction.
mutation_classes: &'static [&'static str]Mutation class names (e.g. “Financial”, “InPlace”).
Implementations§
Source§impl ContextDescriptor
impl ContextDescriptor
Sourcepub const fn account_count(&self) -> usize
pub const fn account_count(&self) -> usize
Number of accounts in this context.
Sourcepub fn signer_count(&self) -> usize
pub fn signer_count(&self) -> usize
Number of signer accounts.
Sourcepub fn writable_count(&self) -> usize
pub fn writable_count(&self) -> usize
Number of writable accounts.
Sourcepub fn find_account(&self, name: &str) -> Option<&ContextAccountDescriptor>
pub fn find_account(&self, name: &str) -> Option<&ContextAccountDescriptor>
Find an account descriptor by field name.
Source§impl ContextDescriptor
impl ContextDescriptor
Sourcepub const fn resolver_count(&self) -> usize
pub const fn resolver_count(&self) -> usize
Number of account resolver descriptors this context can expose.
Sourcepub const fn effect_count(&self) -> usize
pub const fn effect_count(&self) -> usize
Number of derived instruction effects, including receipt emission.
Sourcepub fn find_resolver(&self, account: &str) -> Option<AccountResolverDescriptor>
pub fn find_resolver(&self, account: &str) -> Option<AccountResolverDescriptor>
Find the resolver descriptor for a named account.
Sourcepub fn find_effect(&self, target: &str) -> Option<InstructionEffectDescriptor>
pub fn find_effect(&self, target: &str) -> Option<InstructionEffectDescriptor>
Find the primary effect descriptor for a named account.
Trait Implementations§
Source§impl Clone for ContextDescriptor
impl Clone for ContextDescriptor
Source§fn clone(&self) -> ContextDescriptor
fn clone(&self) -> ContextDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more