pub trait SysvarSerialize:
Sysvar
+ SysvarId
+ Serialize
+ DeserializeOwned {
// Provided methods
fn size_of() -> usize { ... }
fn from_account_info(
account_info: &AccountInfo<'_>,
) -> Result<Self, ProgramError> { ... }
fn to_account_info(&self, account_info: &mut AccountInfo<'_>) -> Option<()> { ... }
}Expand description
A type that holds sysvar data.
Provided Methods§
Sourcefn from_account_info(
account_info: &AccountInfo<'_>,
) -> Result<Self, ProgramError>
fn from_account_info( account_info: &AccountInfo<'_>, ) -> Result<Self, ProgramError>
Deserializes the sysvar from its AccountInfo.
§Errors
If account_info does not have the same ID as the sysvar this function
returns ProgramError::InvalidArgument.
Sourcefn to_account_info(&self, account_info: &mut AccountInfo<'_>) -> Option<()>
fn to_account_info(&self, account_info: &mut AccountInfo<'_>) -> Option<()>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl SysvarSerialize for EpochSchedule
Available on crate feature
bincode only.impl SysvarSerialize for SlotHashes
Available on crate feature
bincode only.impl SysvarSerialize for SlotHistory
Available on crate feature
bincode only.impl SysvarSerialize for Clock
Available on crate feature
bincode only.impl SysvarSerialize for EpochRewards
Available on crate feature
bincode only.impl SysvarSerialize for Fees
Available on crate feature
bincode only.impl SysvarSerialize for LastRestartSlot
Available on crate feature
bincode only.impl SysvarSerialize for RecentBlockhashes
Available on crate feature
bincode only.impl SysvarSerialize for Rent
Available on crate feature
bincode only.impl SysvarSerialize for Rewards
Available on crate feature
bincode only.