pub enum StoredValue {
Show 21 variants
CLValue(CLValue),
Account(Account),
ContractWasm(ContractWasm),
Contract(Contract),
ContractPackage(ContractPackage),
Transfer(TransferV1),
DeployInfo(DeployInfo),
EraInfo(EraInfo),
Bid(Box<Bid>),
Withdraw(Vec<WithdrawPurse>),
Unbonding(Vec<UnbondingPurse>),
AddressableEntity(AddressableEntity),
BidKind(BidKind),
SmartContract(Package),
ByteCode(ByteCode),
MessageTopic(MessageTopicSummary),
Message(MessageChecksum),
NamedKey(NamedKeyValue),
Prepayment(PrepaymentKind),
EntryPoint(EntryPointValue),
RawBytes(Vec<u8>),
}Expand description
A value stored in Global State.
Variants§
CLValue(CLValue)
A CLValue.
Account(Account)
An account.
ContractWasm(ContractWasm)
Contract wasm.
Contract(Contract)
A contract.
ContractPackage(ContractPackage)
A contract package.
Transfer(TransferV1)
A version 1 transfer.
DeployInfo(DeployInfo)
Info about a deploy.
EraInfo(EraInfo)
Info about an era.
Bid(Box<Bid>)
Variant that stores Bid.
Withdraw(Vec<WithdrawPurse>)
Variant that stores withdraw information.
Unbonding(Vec<UnbondingPurse>)
Unbonding information.
AddressableEntity(AddressableEntity)
An AddressableEntity.
BidKind(BidKind)
Variant that stores BidKind.
SmartContract(Package)
A smart contract Package.
ByteCode(ByteCode)
A record of byte code.
MessageTopic(MessageTopicSummary)
Variant that stores a message topic.
Message(MessageChecksum)
Variant that stores a message digest.
NamedKey(NamedKeyValue)
A NamedKey record.
Prepayment(PrepaymentKind)
A prepayment record.
EntryPoint(EntryPointValue)
An entrypoint record.
RawBytes(Vec<u8>)
Raw bytes. Similar to a crate::StoredValue::CLValue but does not incur overhead of a
crate::CLValue and crate::CLType.
Implementations§
Source§impl StoredValue
impl StoredValue
Sourcepub fn as_cl_value(&self) -> Option<&CLValue>
pub fn as_cl_value(&self) -> Option<&CLValue>
Returns a reference to the wrapped CLValue if this is a CLValue variant.
Sourcepub fn as_account(&self) -> Option<&Account>
pub fn as_account(&self) -> Option<&Account>
Returns a reference to the wrapped Account if this is an Account variant.
Sourcepub fn as_byte_code(&self) -> Option<&ByteCode>
pub fn as_byte_code(&self) -> Option<&ByteCode>
Returns a reference to the wrapped ByteCode if this is a ByteCode variant.
pub fn as_contract_wasm(&self) -> Option<&ContractWasm>
Sourcepub fn as_contract(&self) -> Option<&Contract>
pub fn as_contract(&self) -> Option<&Contract>
Returns a reference to the wrapped Contract if this is a Contract variant.
Sourcepub fn as_package(&self) -> Option<&Package>
pub fn as_package(&self) -> Option<&Package>
Returns a reference to the wrapped Package if this is a Package variant.
Sourcepub fn as_contract_package(&self) -> Option<&ContractPackage>
pub fn as_contract_package(&self) -> Option<&ContractPackage>
Returns a reference to the wrapped ContractPackage if this is a ContractPackage variant.
Sourcepub fn as_transfer(&self) -> Option<&TransferV1>
pub fn as_transfer(&self) -> Option<&TransferV1>
Returns a reference to the wrapped TransferV1 if this is a Transfer variant.
Sourcepub fn as_deploy_info(&self) -> Option<&DeployInfo>
pub fn as_deploy_info(&self) -> Option<&DeployInfo>
Returns a reference to the 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 reference to the wrapped EraInfo if this is an EraInfo variant.
Sourcepub fn as_bid(&self) -> Option<&Bid>
pub fn as_bid(&self) -> Option<&Bid>
Returns a reference to the wrapped Bid if this is a Bid variant.
Sourcepub fn as_withdraw(&self) -> Option<&Vec<WithdrawPurse>>
pub fn as_withdraw(&self) -> Option<&Vec<WithdrawPurse>>
Returns a reference to the wrapped list of WithdrawPurses if this is a Withdraw variant.
Sourcepub fn as_unbonding(&self) -> Option<&Vec<UnbondingPurse>>
pub fn as_unbonding(&self) -> Option<&Vec<UnbondingPurse>>
Returns a reference to the wrapped list of UnbondingPurses if this is an Unbonding
variant.
Sourcepub fn as_unbond(&self) -> Option<&Unbond>
pub fn as_unbond(&self) -> Option<&Unbond>
Returns a reference to the wrapped list of UnbondingPurses if this is an Unbonding
variant.
Sourcepub fn as_addressable_entity(&self) -> Option<&AddressableEntity>
pub fn as_addressable_entity(&self) -> Option<&AddressableEntity>
Returns a reference to the wrapped AddressableEntity if this is an AddressableEntity
variant.
Sourcepub fn as_message_topic_summary(&self) -> Option<&MessageTopicSummary>
pub fn as_message_topic_summary(&self) -> Option<&MessageTopicSummary>
Returns a reference to the wrapped MessageTopicSummary if this is a MessageTopic
variant.
Sourcepub fn as_message_checksum(&self) -> Option<&MessageChecksum>
pub fn as_message_checksum(&self) -> Option<&MessageChecksum>
Returns a reference to the wrapped MessageChecksum if this is a Message
variant.
Sourcepub fn as_bid_kind(&self) -> Option<&BidKind>
pub fn as_bid_kind(&self) -> Option<&BidKind>
Returns a reference to the wrapped BidKind if this is a BidKind variant.
Sourcepub fn as_raw_bytes(&self) -> Option<&[u8]>
pub fn as_raw_bytes(&self) -> Option<&[u8]>
Returns raw bytes if this is a RawBytes variant.
Sourcepub fn as_entry_point_value(&self) -> Option<&EntryPointValue>
pub fn as_entry_point_value(&self) -> Option<&EntryPointValue>
Returns a reference to the wrapped EntryPointValue if this is a EntryPointValue variant.
Sourcepub fn into_cl_value(self) -> Option<CLValue>
pub fn into_cl_value(self) -> Option<CLValue>
Returns the CLValue if this is a CLValue variant.
Sourcepub fn into_account(self) -> Option<Account>
pub fn into_account(self) -> Option<Account>
Returns the Account if this is an Account variant.
Sourcepub fn into_contract_wasm(self) -> Option<ContractWasm>
pub fn into_contract_wasm(self) -> Option<ContractWasm>
Returns the ContractWasm if this is a ContractWasm variant.
Sourcepub fn into_contract(self) -> Option<Contract>
pub fn into_contract(self) -> Option<Contract>
Returns the Contract if this is a Contract variant.
Sourcepub fn into_contract_package(self) -> Option<ContractPackage>
pub fn into_contract_package(self) -> Option<ContractPackage>
Returns the ContractPackage if this is a ContractPackage variant.
Sourcepub fn into_package(self) -> Option<Package>
pub fn into_package(self) -> Option<Package>
Returns the Package if this is a Package variant.
Sourcepub fn into_legacy_transfer(self) -> Option<TransferV1>
pub fn into_legacy_transfer(self) -> Option<TransferV1>
Returns the TransferV1 if this is a Transfer variant.
Sourcepub fn into_deploy_info(self) -> Option<DeployInfo>
pub fn into_deploy_info(self) -> Option<DeployInfo>
Returns the DeployInfo if this is a DeployInfo variant.
Sourcepub fn into_era_info(self) -> Option<EraInfo>
pub fn into_era_info(self) -> Option<EraInfo>
Returns the EraInfo if this is an EraInfo variant.
Sourcepub fn into_withdraw(self) -> Option<Vec<WithdrawPurse>>
pub fn into_withdraw(self) -> Option<Vec<WithdrawPurse>>
Returns the list of WithdrawPurses if this is a Withdraw variant.
Sourcepub fn into_unbonding(self) -> Option<Vec<UnbondingPurse>>
pub fn into_unbonding(self) -> Option<Vec<UnbondingPurse>>
Returns the list of UnbondingPurses if this is an Unbonding variant.
Sourcepub fn into_addressable_entity(self) -> Option<AddressableEntity>
pub fn into_addressable_entity(self) -> Option<AddressableEntity>
Returns the AddressableEntity if this is an AddressableEntity variant.
Sourcepub fn into_bid_kind(self) -> Option<BidKind>
pub fn into_bid_kind(self) -> Option<BidKind>
Returns the BidKind if this is a BidKind variant.
Sourcepub fn into_entry_point_value(self) -> Option<EntryPointValue>
pub fn into_entry_point_value(self) -> Option<EntryPointValue>
Returns the EntryPointValue if this is a EntryPointValue variant.
Sourcepub fn type_name(&self) -> String
pub fn type_name(&self) -> String
Returns the type name of the StoredValue enum variant.
Sourcepub fn tag(&self) -> StoredValueTag
pub fn tag(&self) -> StoredValueTag
Returns the tag of the StoredValue.
Sourcepub fn into_byte_code(self) -> Option<ByteCode>
pub fn into_byte_code(self) -> Option<ByteCode>
Returns the serialized length of the StoredValue.
Sourcepub fn into_named_key(self) -> Option<NamedKeyValue>
pub fn into_named_key(self) -> Option<NamedKeyValue>
Returns the serialized length of the StoredValue.
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 DataSize for StoredValuewhere
CLValue: DataSize,
Account: DataSize,
ContractWasm: DataSize,
Contract: DataSize,
ContractPackage: DataSize,
TransferV1: DataSize,
DeployInfo: DataSize,
EraInfo: DataSize,
Box<Bid>: DataSize,
Vec<WithdrawPurse>: DataSize,
Vec<UnbondingPurse>: DataSize,
AddressableEntity: DataSize,
BidKind: DataSize,
Package: DataSize,
ByteCode: DataSize,
MessageTopicSummary: DataSize,
MessageChecksum: DataSize,
NamedKeyValue: DataSize,
PrepaymentKind: DataSize,
EntryPointValue: DataSize,
Vec<u8>: DataSize,
impl DataSize for StoredValuewhere
CLValue: DataSize,
Account: DataSize,
ContractWasm: DataSize,
Contract: DataSize,
ContractPackage: DataSize,
TransferV1: DataSize,
DeployInfo: DataSize,
EraInfo: DataSize,
Box<Bid>: DataSize,
Vec<WithdrawPurse>: DataSize,
Vec<UnbondingPurse>: DataSize,
AddressableEntity: DataSize,
BidKind: DataSize,
Package: DataSize,
ByteCode: DataSize,
MessageTopicSummary: DataSize,
MessageChecksum: DataSize,
NamedKeyValue: DataSize,
PrepaymentKind: DataSize,
EntryPointValue: DataSize,
Vec<u8>: DataSize,
Source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
true, the type has a heap size that can vary at runtime, depending on the actual value.Source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
IS_DYNAMIC is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.Source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Source§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<AddressableEntity> for StoredValue
impl From<AddressableEntity> for StoredValue
Source§fn from(value: AddressableEntity) -> StoredValue
fn from(value: AddressableEntity) -> 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<BidKind> for StoredValue
impl From<BidKind> for StoredValue
Source§fn from(bid_kind: BidKind) -> StoredValue
fn from(bid_kind: BidKind) -> StoredValue
Source§impl From<ByteCode> for StoredValue
impl From<ByteCode> for StoredValue
Source§fn from(value: ByteCode) -> StoredValue
fn from(value: ByteCode) -> 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§impl From<ContractPackage> for StoredValue
impl From<ContractPackage> for StoredValue
Source§fn from(value: ContractPackage) -> Self
fn from(value: ContractPackage) -> Self
Source§impl From<ContractWasm> for StoredValue
impl From<ContractWasm> for StoredValue
Source§fn from(value: ContractWasm) -> Self
fn from(value: ContractWasm) -> Self
Source§impl From<EntryPointValue> for StoredValue
impl From<EntryPointValue> for StoredValue
Source§fn from(value: EntryPointValue) -> Self
fn from(value: EntryPointValue) -> Self
Source§impl From<Package> for StoredValue
impl From<Package> for StoredValue
Source§fn from(value: Package) -> StoredValue
fn from(value: Package) -> StoredValue
Source§impl From<StoredValue> for TransformInstruction
impl From<StoredValue> for TransformInstruction
Source§fn from(value: StoredValue) -> Self
fn from(value: StoredValue) -> Self
Source§impl FromBytes for StoredValue
impl FromBytes for StoredValue
Source§impl JsonSchema for StoredValue
impl JsonSchema for StoredValue
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for StoredValue
impl PartialEq for StoredValue
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.Source§impl TryFrom<StoredValue> for Account
impl TryFrom<StoredValue> for Account
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for AddressableEntity
impl TryFrom<StoredValue> for AddressableEntity
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for Bid
impl TryFrom<StoredValue> for Bid
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for BidKind
impl TryFrom<StoredValue> for BidKind
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for ByteCode
impl TryFrom<StoredValue> for ByteCode
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for CLValue
impl TryFrom<StoredValue> for CLValue
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for Contract
impl TryFrom<StoredValue> for Contract
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for ContractPackage
impl TryFrom<StoredValue> for ContractPackage
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for ContractWasm
impl TryFrom<StoredValue> for ContractWasm
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for DeployInfo
impl TryFrom<StoredValue> for DeployInfo
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for EraInfo
impl TryFrom<StoredValue> for EraInfo
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for NamedKeyValue
impl TryFrom<StoredValue> for NamedKeyValue
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for Package
impl TryFrom<StoredValue> for Package
Source§type Error = TypeMismatch
type Error = TypeMismatch
Source§impl TryFrom<StoredValue> for TransferV1
impl TryFrom<StoredValue> for TransferV1
Source§type Error = TypeMismatch
type Error = TypeMismatch
impl Eq for StoredValue
impl StructuralPartialEq for StoredValue
Auto Trait Implementations§
impl Freeze for StoredValue
impl RefUnwindSafe for StoredValue
impl Send for StoredValue
impl Sync for StoredValue
impl Unpin for StoredValue
impl UnwindSafe for StoredValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more