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.
Trait Implementations§
Source§impl Clone for ContextDescriptor
impl Clone for ContextDescriptor
Source§fn clone(&self) -> ContextDescriptor
fn clone(&self) -> ContextDescriptor
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 moreSource§impl Display for ContextDescriptor
impl Display for ContextDescriptor
impl Copy for ContextDescriptor
Auto Trait Implementations§
impl Freeze for ContextDescriptor
impl RefUnwindSafe for ContextDescriptor
impl Send for ContextDescriptor
impl Sync for ContextDescriptor
impl Unpin for ContextDescriptor
impl UnsafeUnpin for ContextDescriptor
impl UnwindSafe for ContextDescriptor
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