#[repr(C)]pub struct RentConfig {
pub base_rent: u16,
pub compression_cost: u16,
pub lamports_per_byte_per_epoch: u8,
pub max_funded_epochs: u8,
pub max_top_up: u16,
}Expand description
Rent function parameters, used to calculate whether the account is compressible.
Fields§
§base_rent: u16Base rent constant: rent = base_rent + num_bytes * lamports_per_byte_per_epoch
compression_cost: u16§lamports_per_byte_per_epoch: u8§max_funded_epochs: u8§max_top_up: u16Maximum lamports that can be charged per top-up operation. Protects against griefing by accounts with high lamports_per_write.
Implementations§
Trait Implementations§
Source§impl BorshDeserialize for RentConfig
impl BorshDeserialize for RentConfig
fn deserialize_reader<R>(reader: &mut R) -> Result<RentConfig, Error>where
R: Read,
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 RentConfig
impl BorshSerialize for RentConfig
Source§impl Clone for RentConfig
impl Clone for RentConfig
Source§fn clone(&self) -> RentConfig
fn clone(&self) -> RentConfig
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 moreSource§impl Debug for RentConfig
impl Debug for RentConfig
Source§impl Default for RentConfig
impl Default for RentConfig
Source§fn default() -> RentConfig
fn default() -> RentConfig
Returns the “default value” for a type. Read more
Source§impl Hash for RentConfig
impl Hash for RentConfig
Source§impl PartialEq for RentConfig
impl PartialEq for RentConfig
Source§impl RentConfigTrait for RentConfig
impl RentConfigTrait for RentConfig
Source§fn compression_cost(&self) -> u64
fn compression_cost(&self) -> u64
Get the compression cost
Source§fn lamports_per_byte_per_epoch(&self) -> u64
fn lamports_per_byte_per_epoch(&self) -> u64
Get lamports per byte per epoch
Source§fn max_funded_epochs(&self) -> u64
fn max_funded_epochs(&self) -> u64
Get maximum funded epochs
Source§fn max_top_up(&self) -> u64
fn max_top_up(&self) -> u64
Get maximum top-up amount per write operation
Source§fn rent_curve_per_epoch(&self, num_bytes: u64) -> u64
fn rent_curve_per_epoch(&self, num_bytes: u64) -> u64
Calculate rent per epoch for a given number of bytes
Source§impl<'a> ZeroCopyAt<'a> for RentConfig
impl<'a> ZeroCopyAt<'a> for RentConfig
type ZeroCopyAt = ZRentConfig<'a>
fn zero_copy_at( __remaining_bytes: &'a [u8], ) -> Result<(<RentConfig as ZeroCopyAt<'a>>::ZeroCopyAt, &'a [u8]), ZeroCopyError>
Source§impl<'a> ZeroCopyAtMut<'a> for RentConfig
impl<'a> ZeroCopyAtMut<'a> for RentConfig
type ZeroCopyAtMut = ZRentConfigMut<'a>
fn zero_copy_at_mut( __remaining_bytes: &'a mut [u8], ) -> Result<(<RentConfig as ZeroCopyAtMut<'a>>::ZeroCopyAtMut, &'a mut [u8]), ZeroCopyError>
Source§impl<'a> ZeroCopyNew<'a> for RentConfig
impl<'a> ZeroCopyNew<'a> for RentConfig
Source§type ZeroCopyConfig = ()
type ZeroCopyConfig = ()
Configuration type needed to initialize this type
Source§type Output = <RentConfig as ZeroCopyAtMut<'a>>::ZeroCopyAtMut
type Output = <RentConfig as ZeroCopyAtMut<'a>>::ZeroCopyAtMut
Output type - the mutable zero-copy view of this type
Source§fn byte_len(
config: &<RentConfig as ZeroCopyNew<'a>>::ZeroCopyConfig,
) -> Result<usize, ZeroCopyError>
fn byte_len( config: &<RentConfig as ZeroCopyNew<'a>>::ZeroCopyConfig, ) -> Result<usize, ZeroCopyError>
Calculate the byte length needed for this type with the given configuration Read more
Source§fn new_zero_copy(
__remaining_bytes: &'a mut [u8],
config: <RentConfig as ZeroCopyNew<'a>>::ZeroCopyConfig,
) -> Result<(<RentConfig as ZeroCopyNew<'a>>::Output, &'a mut [u8]), ZeroCopyError>
fn new_zero_copy( __remaining_bytes: &'a mut [u8], config: <RentConfig as ZeroCopyNew<'a>>::ZeroCopyConfig, ) -> Result<(<RentConfig as ZeroCopyNew<'a>>::Output, &'a mut [u8]), ZeroCopyError>
Initialize this type in a mutable byte slice with the given configuration Read more
Source§impl ZeroCopyStructInner for RentConfig
impl ZeroCopyStructInner for RentConfig
type ZeroCopyInner = ZRentConfig<'static>
Source§impl ZeroCopyStructInnerMut for RentConfig
impl ZeroCopyStructInnerMut for RentConfig
type ZeroCopyInnerMut = ZRentConfigMut<'static>
impl Copy for RentConfig
impl Eq for RentConfig
impl Pod for RentConfig
impl StructuralPartialEq for RentConfig
Auto Trait Implementations§
impl Freeze for RentConfig
impl RefUnwindSafe for RentConfig
impl Send for RentConfig
impl Sync for RentConfig
impl Unpin for RentConfig
impl UnwindSafe for RentConfig
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.