Skip to main content

ResizeWithPayer

Struct ResizeWithPayer 

Source
pub struct ResizeWithPayer<'a, 'info> {
    pub account: &'a AccountView<'info>,
    pub payer: &'a AccountView<'info>,
    pub system_program: &'a AccountView<'info>,
    pub program_id: &'a Address,
    pub new_len: usize,
}
Expand description

Resize program-owned state, funding only missing rent through System CPI.

The default invocation reads live rent. Growth is checked against the length at instruction entry before a payer is charged. Newly exposed bytes are zeroed; shrinking retains excess lamports in the account. This does not authorize an application’s resize: validate its authority before invoking this builder. program_id must be the current entrypoint’s program ID.

Fields§

§account: &'a AccountView<'info>§payer: &'a AccountView<'info>§system_program: &'a AccountView<'info>§program_id: &'a Address§new_len: usize

Implementations§

Source§

impl ResizeWithPayer<'_, '_>

Source

pub fn invoke(&self) -> ProgramResult

Fund from a transaction signer using the live Rent sysvar.

Source

pub fn invoke_signed(&self, signers: &[Signer<'_, '_>]) -> ProgramResult

Also support a System-owned PDA payer derived by the current program. Nonempty signer seeds are verified by the SVM, not assumed valid here.

Source

pub fn invoke_signed_with_rent( &self, rent: &Rent, signers: &[Signer<'_, '_>], ) -> ProgramResult

Reuse a Rent value already read from the target cluster in this instruction. A fabricated or stale rent value can underfund the account; use invoke unless the caller already has the live sysvar.

Auto Trait Implementations§

§

impl<'a, 'info> !Send for ResizeWithPayer<'a, 'info>

§

impl<'a, 'info> !Sync for ResizeWithPayer<'a, 'info>

§

impl<'a, 'info> Freeze for ResizeWithPayer<'a, 'info>

§

impl<'a, 'info> RefUnwindSafe for ResizeWithPayer<'a, 'info>

§

impl<'a, 'info> Unpin for ResizeWithPayer<'a, 'info>

§

impl<'a, 'info> UnsafeUnpin for ResizeWithPayer<'a, 'info>

§

impl<'a, 'info> UnwindSafe for ResizeWithPayer<'a, 'info>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.