RentConfigTrait

Trait RentConfigTrait 

Source
pub trait RentConfigTrait {
    // Required methods
    fn base_rent(&self) -> u64;
    fn compression_cost(&self) -> u64;
    fn lamports_per_byte_per_epoch(&self) -> u64;
    fn max_funded_epochs(&self) -> u64;
    fn max_top_up(&self) -> u64;

    // Provided methods
    fn rent_curve_per_epoch(&self, num_bytes: u64) -> u64 { ... }
    fn get_rent(&self, num_bytes: u64, epochs: u64) -> u64 { ... }
    fn get_rent_with_compression_cost(&self, num_bytes: u64, epochs: u64) -> u64 { ... }
}
Expand description

Trait for accessing rent configuration parameters.

This trait allows both owned RentConfig and zero-copy versions (ZRentConfig, ZRentConfigMut) to be used interchangeably with AccountRentState methods.

Required Methods§

Source

fn base_rent(&self) -> u64

Get the base rent value

Source

fn compression_cost(&self) -> u64

Get the compression cost

Source

fn lamports_per_byte_per_epoch(&self) -> u64

Get lamports per byte per epoch

Source

fn max_funded_epochs(&self) -> u64

Get maximum funded epochs

Source

fn max_top_up(&self) -> u64

Get maximum top-up amount per write operation

Provided Methods§

Source

fn rent_curve_per_epoch(&self, num_bytes: u64) -> u64

Calculate rent per epoch for a given number of bytes

Source

fn get_rent(&self, num_bytes: u64, epochs: u64) -> u64

Calculate total rent for given bytes and epochs

Source

fn get_rent_with_compression_cost(&self, num_bytes: u64, epochs: u64) -> u64

Calculate total rent including compression cost

Implementors§