#[derive(Deserialize, PartialEq, Eq, Clone, Default)] #[serde(rename_all = "camelCase")] pubstructAccount { /// lamports in the account -- Sol 余额,lamports 是最小单位 pub lamports: u64, /// data held in this account -- 存储数据,和合约或用户相关 #[serde(with = "serde_bytes")] pub data: Vec<u8>, /// the program that owns this account. If executable, the program that loads this account. -- 所有者的数据和权限 pub owner: Pubkey, /// this account's data contains a loaded program (and is now read-only) -- data 中存放的是否为可执行代码 pub executable: bool, /// the epoch at which this account will next owe rent -- 租金,存储程序在 Sol 上需要收费 pub rent_epoch: Epoch, }
/// Account information #[derive(Clone)] #[repr(C)] pubstructAccountInfo<'a> { /// Public key of the account -- 公钥,账户唯一标识 pub key: &'a Pubkey, /// The lamports in the account. Modifiable by programs. -- Sol 余额 pub lamports: Rc<RefCell<&'amutu64>>, /// The data held in this account. Modifiable by programs. -- 同 Account pub data: Rc<RefCell<&'amut [u8]>>, /// Program that owns this account -- 同 Account pub owner: &'a Pubkey, /// The epoch at which this account will next owe rent -- 同 Account pub rent_epoch: Epoch, /// Was the transaction signed by this account's public key? -- 当前交易是否被该账户的公钥签名了 pub is_signer: bool, /// Is the account writable? -- 是否能被修改 pub is_writable: bool, /// This account's data contains a loaded program (and is now read-only) -- 同 Account pub executable: bool, }