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

Implementations on Foreign Types

Implementors

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.

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.