pub trait SysvarSerialize:
Default
+ 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<()> { ... }
}👎Deprecated since 4.3.0:
Use wincode::deserialize and check the sysvar account address
Available on crate feature
bincode only.Expand description
A type that holds sysvar data.
Provided Methods§
Sourcefn size_of() -> usize
👎Deprecated since 4.3.0: Use the sysvar crate’s SIZE constant or wincode::serialized_size
fn size_of() -> usize
Use the sysvar crate’s SIZE constant or wincode::serialized_size
The size in bytes of the sysvar as serialized account data.
Sourcefn from_account_info(
account_info: &AccountInfo<'_>,
) -> Result<Self, ProgramError>
👎Deprecated since 4.3.0: Use wincode::deserialize and check the account address
fn from_account_info( account_info: &AccountInfo<'_>, ) -> Result<Self, ProgramError>
Use wincode::deserialize and check the account address
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<()>
👎Deprecated since 4.3.0: Use wincode::serialize_into
fn to_account_info(&self, account_info: &mut AccountInfo<'_>) -> Option<()>
Use wincode::serialize_into
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".