Trait anchor_lang::AccountsClose
source · [−]pub trait AccountsClose<'info>: ToAccountInfos<'info> {
fn close(&self, sol_destination: AccountInfo<'info>) -> Result<()>;
}
Expand description
The close procedure to initiate garabage collection of an account, allowing one to retrieve the rent exemption.
Required methods
fn close(&self, sol_destination: AccountInfo<'info>) -> Result<()>
Implementations on Foreign Types
sourceimpl<'info, T: AccountsClose<'info>> AccountsClose<'info> for Box<T>
impl<'info, T: AccountsClose<'info>> AccountsClose<'info> for Box<T>
fn close(&self, sol_destination: AccountInfo<'info>) -> Result<()>
Implementors
impl<'info, T: AccountSerialize + AccountDeserialize + Owner + Clone> AccountsClose<'info> for Account<'info, T>
This function is for INTERNAL USE ONLY.
Do NOT use this function in a program.
Manual closing of Account<'info, T>
types is NOT supported.
Details: Using close
with Account<'info, T>
is not safe because
it requires the mut
constraint but for that type the constraint
overwrites the “closed account” discriminator at the end of the instruction.
impl<'info, T: ZeroCopy + Owner> AccountsClose<'info> for AccountLoader<'info, T>
This function is for INTERNAL USE ONLY.
Do NOT use this function in a program.
Manual closing of AccountLoader<'info, T>
types is NOT supported.
Details: Using close
with AccountLoader<'info, T>
is not safe because
it requires the mut
constraint but for that type the constraint
overwrites the “closed account” discriminator at the end of the instruction.