Skip to main content

ContextAccountDescriptor

Struct ContextAccountDescriptor 

Source
pub struct ContextAccountDescriptor {
Show 14 fields pub name: &'static str, pub kind: &'static str, pub writable: bool, pub signer: bool, pub layout_ref: &'static str, pub policy_ref: &'static str, pub seeds: &'static [&'static str], pub optional: bool, pub lifecycle: AccountLifecycle, pub payer: &'static str, pub init_space: u32, pub has_one: &'static [&'static str], pub expected_address: &'static str, pub expected_owner: &'static str,
}
Expand description

Schema descriptor for a single account field within a context.

Richer than the basic AccountEntry – captures the full Account DSL surface including kind, layout, policy, seeds, optionality, and the Anchor-grade lifecycle flags (init/close/realloc/has_one) that the Hopper Safety Audit’s ST2 closure requires client generators to consume.

Fields§

§name: &'static str

Field name in the struct (e.g. “vault”, “authority”).

§kind: &'static str

Account wrapper kind (e.g. “HopperAccount”, “Signer”, “ProgramRef”).

§writable: bool

Whether the account is writable.

§signer: bool

Whether the account must be a signer.

§layout_ref: &'static str

Layout name bound via layout = T, if any (empty string if none).

§policy_ref: &'static str

Policy pack name bound via policy = P, if any (empty string if none).

§seeds: &'static [&'static str]

PDA seed expressions as string representations.

§optional: bool

Whether the account is optional (may be omitted by the caller).

§lifecycle: AccountLifecycle

Lifecycle role the account plays in this instruction. Clients use this to synthesize appropriate builder helpers (findPda, initAccount, closeTo, etc.).

§payer: &'static str

Name of the field whose key pays CPI fees / rent top-up for init or realloc. Empty if not applicable.

§init_space: u32

Byte count required for init. None (represented as 0) if not applicable.

§has_one: &'static [&'static str]

Fields listed in has_one = ..., required to equal the corresponding layout field by public key.

§expected_address: &'static str

Address the caller must provide, if pinned via address = EXPR (base58 form for pubkey literals; empty string if not pinned).

§expected_owner: &'static str

Program owner the account must be owned by, if pinned via owner = EXPR. Empty string means “owned by the current program”.

Trait Implementations§

Source§

impl Clone for ContextAccountDescriptor

Source§

fn clone(&self) -> ContextAccountDescriptor

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 ContextAccountDescriptor

Source§

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

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

impl Copy for ContextAccountDescriptor

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.