pub struct CompressibleConfig {
pub version: u8,
pub write_top_up: u32,
pub update_authority: Pubkey,
pub rent_sponsor: Pubkey,
pub compression_authority: Pubkey,
pub rent_config: RentConfig,
pub config_bump: u8,
pub bump: u8,
pub address_space: Vec<Pubkey>,
}Expand description
Global configuration for compressible accounts
Fields§
§version: u8Config version for future upgrades
write_top_up: u32Lamports to top up on each write (heuristic)
Authority that can update the config
rent_sponsor: PubkeyAccount that receives rent from compressed PDAs
Authority that can compress/close PDAs (distinct from rent_sponsor)
rent_config: RentConfigRent function parameters for compressibility and distribution
config_bump: u8Config bump seed (0)
bump: u8PDA bump seed
address_space: Vec<Pubkey>Address space for compressed accounts (currently 1 address_tree allowed)
Implementations§
Source§impl CompressibleConfig
impl CompressibleConfig
pub const LEN: usize = 147usize
Sourcepub fn size_for_address_space(num_address_trees: usize) -> usize
pub fn size_for_address_space(num_address_trees: usize) -> usize
Calculate the exact size needed for a CompressibleConfig with the given number of address spaces
Sourcepub fn derive_pda(program_id: &Pubkey, config_bump: u8) -> (Pubkey, u8)
pub fn derive_pda(program_id: &Pubkey, config_bump: u8) -> (Pubkey, u8)
Derives the config PDA address with config bump
Sourcepub fn derive_default_pda(program_id: &Pubkey) -> (Pubkey, u8)
pub fn derive_default_pda(program_id: &Pubkey) -> (Pubkey, u8)
Derives the default config PDA address (config_bump = 0)
Sourcepub fn validate(&self) -> Result<(), ProgramError>
pub fn validate(&self) -> Result<(), ProgramError>
Checks the config account
Sourcepub fn load_checked(
account: &AccountInfo<'_>,
program_id: &Pubkey,
) -> Result<Self, ProgramError>
pub fn load_checked( account: &AccountInfo<'_>, program_id: &Pubkey, ) -> Result<Self, ProgramError>
Loads and validates config from account, checking owner and PDA derivation
Trait Implementations§
Source§impl BorshDeserialize for CompressibleConfig
impl BorshDeserialize for CompressibleConfig
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for CompressibleConfigwhere
u8: BorshSerialize,
u32: BorshSerialize,
Pubkey: BorshSerialize,
RentConfig: BorshSerialize,
Vec<Pubkey>: BorshSerialize,
impl BorshSerialize for CompressibleConfigwhere
u8: BorshSerialize,
u32: BorshSerialize,
Pubkey: BorshSerialize,
RentConfig: BorshSerialize,
Vec<Pubkey>: BorshSerialize,
Source§impl Clone for CompressibleConfig
impl Clone for CompressibleConfig
Source§fn clone(&self) -> CompressibleConfig
fn clone(&self) -> CompressibleConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompressibleConfig
impl RefUnwindSafe for CompressibleConfig
impl Send for CompressibleConfig
impl Sync for CompressibleConfig
impl Unpin for CompressibleConfig
impl UnwindSafe for CompressibleConfig
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