Enum casper_types::StoredValue
source · pub enum StoredValue {
CLValue(CLValue),
Account(Account),
ContractWasm(ContractWasm),
Contract(Contract),
ContractPackage(ContractPackage),
Transfer(Transfer),
DeployInfo(DeployInfo),
EraInfo(EraInfo),
Bid(Box<Bid>),
Withdraw(Vec<WithdrawPurse>),
Unbonding(Vec<UnbondingPurse>),
}
Expand description
StoredValue represents all possible variants of values stored in Global State.
Variants§
CLValue(CLValue)
Variant that stores CLValue
.
Account(Account)
Variant that stores Account
.
ContractWasm(ContractWasm)
Variant that stores ContractWasm
.
Contract(Contract)
Variant that stores Contract
.
ContractPackage(ContractPackage)
Variant that stores ContractPackage
.
Transfer(Transfer)
Variant that stores Transfer
.
DeployInfo(DeployInfo)
Variant that stores DeployInfo
.
EraInfo(EraInfo)
Variant that stores EraInfo
.
Bid(Box<Bid>)
Variant that stores Bid
.
Withdraw(Vec<WithdrawPurse>)
Variant that stores withdraw information.
Unbonding(Vec<UnbondingPurse>)
Variant that stores unbonding information.
Implementations§
source§impl StoredValue
impl StoredValue
sourcepub fn as_cl_value(&self) -> Option<&CLValue>
pub fn as_cl_value(&self) -> Option<&CLValue>
Returns a wrapped CLValue
if this is a CLValue
variant.
sourcepub fn as_account(&self) -> Option<&Account>
pub fn as_account(&self) -> Option<&Account>
Returns a wrapped Account
if this is an Account
variant.
sourcepub fn as_contract(&self) -> Option<&Contract>
pub fn as_contract(&self) -> Option<&Contract>
Returns a wrapped Contract
if this is a Contract
variant.
sourcepub fn as_contract_wasm(&self) -> Option<&ContractWasm>
pub fn as_contract_wasm(&self) -> Option<&ContractWasm>
Returns a wrapped ContractWasm
if this is a ContractWasm
variant.
sourcepub fn as_contract_package(&self) -> Option<&ContractPackage>
pub fn as_contract_package(&self) -> Option<&ContractPackage>
Returns a wrapped ContractPackage
if this is a ContractPackage
variant.
sourcepub fn as_deploy_info(&self) -> Option<&DeployInfo>
pub fn as_deploy_info(&self) -> Option<&DeployInfo>
Returns a wrapped DeployInfo
if this is a DeployInfo
variant.
sourcepub fn as_era_info(&self) -> Option<&EraInfo>
pub fn as_era_info(&self) -> Option<&EraInfo>
Returns a wrapped EraInfo
if this is a EraInfo
variant.
sourcepub fn as_withdraw(&self) -> Option<&Vec<WithdrawPurse>>
pub fn as_withdraw(&self) -> Option<&Vec<WithdrawPurse>>
Returns a wrapped list of WithdrawPurse
s if this is a Withdraw
variant.
sourcepub fn as_unbonding(&self) -> Option<&Vec<UnbondingPurse>>
pub fn as_unbonding(&self) -> Option<&Vec<UnbondingPurse>>
Returns a wrapped list of UnbondingPurse
s if this is a Unbonding
variant.
Trait Implementations§
source§impl Clone for StoredValue
impl Clone for StoredValue
source§fn clone(&self) -> StoredValue
fn clone(&self) -> StoredValue
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StoredValue
impl Debug for StoredValue
source§impl<'de> Deserialize<'de> for StoredValue
impl<'de> Deserialize<'de> for StoredValue
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
source§impl From<Account> for StoredValue
impl From<Account> for StoredValue
source§fn from(value: Account) -> StoredValue
fn from(value: Account) -> StoredValue
source§impl From<Bid> for StoredValue
impl From<Bid> for StoredValue
source§fn from(bid: Bid) -> StoredValue
fn from(bid: Bid) -> StoredValue
source§impl From<CLValue> for StoredValue
impl From<CLValue> for StoredValue
source§fn from(value: CLValue) -> StoredValue
fn from(value: CLValue) -> StoredValue
source§impl From<Contract> for StoredValue
impl From<Contract> for StoredValue
source§fn from(value: Contract) -> StoredValue
fn from(value: Contract) -> StoredValue
source§impl From<ContractPackage> for StoredValue
impl From<ContractPackage> for StoredValue
source§fn from(value: ContractPackage) -> StoredValue
fn from(value: ContractPackage) -> StoredValue
source§impl From<ContractWasm> for StoredValue
impl From<ContractWasm> for StoredValue
source§fn from(value: ContractWasm) -> StoredValue
fn from(value: ContractWasm) -> StoredValue
source§impl FromBytes for StoredValue
impl FromBytes for StoredValue
source§impl PartialEq for StoredValue
impl PartialEq for StoredValue
source§fn eq(&self, other: &StoredValue) -> bool
fn eq(&self, other: &StoredValue) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for StoredValue
impl Serialize for StoredValue
source§impl ToBytes for StoredValue
impl ToBytes for StoredValue
source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Vec<u8>
which would be returned from a successful call to
to_bytes()
or into_bytes()
. The data is not actually serialized, so this call is
relatively cheap.