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 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 wrapped list of UnbondingPurses 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<StoredValue> for StoredValue
impl PartialEq<StoredValue> 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.source§impl TryFrom<StoredValue> for Account
impl TryFrom<StoredValue> for Account
§type Error = TypeMismatch
type Error = TypeMismatch
source§impl TryFrom<StoredValue> for CLValue
impl TryFrom<StoredValue> for CLValue
§type Error = TypeMismatch
type Error = TypeMismatch
source§impl TryFrom<StoredValue> for Contract
impl TryFrom<StoredValue> for Contract
§type Error = TypeMismatch
type Error = TypeMismatch
source§impl TryFrom<StoredValue> for ContractPackage
impl TryFrom<StoredValue> for ContractPackage
§type Error = TypeMismatch
type Error = TypeMismatch
source§impl TryFrom<StoredValue> for ContractWasm
impl TryFrom<StoredValue> for ContractWasm
§type Error = TypeMismatch
type Error = TypeMismatch
source§impl TryFrom<StoredValue> for DeployInfo
impl TryFrom<StoredValue> for DeployInfo
§type Error = TypeMismatch
type Error = TypeMismatch
source§impl TryFrom<StoredValue> for EraInfo
impl TryFrom<StoredValue> for EraInfo
§type Error = TypeMismatch
type Error = TypeMismatch
source§impl TryFrom<StoredValue> for Transfer
impl TryFrom<StoredValue> for Transfer
§type Error = TypeMismatch
type Error = TypeMismatch
impl Eq for StoredValue
impl StructuralEq for StoredValue
impl StructuralPartialEq for StoredValue
Auto Trait Implementations§
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§impl<T> Pipe for T
impl<T> Pipe for T
§impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
§impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
§impl<T> PipeDeref for T
impl<T> PipeDeref for T
§impl<T> PipeRef for T
impl<T> PipeRef for T
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,
§fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
fn tap<F, R>(self, func: F) -> Selfwhere F: FnOnce(&Self) -> R,
§fn tap_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Selfwhere F: FnOnce(&Self) -> R,
tap in debug builds, and does nothing in release builds.§fn tap_mut<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Selfwhere F: FnOnce(&mut Self) -> R,
§fn tap_mut_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Selfwhere F: FnOnce(&mut Self) -> R,
tap_mut in debug builds, and does nothing in release builds.§impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
impl<T, U> TapAsRef<U> for Twhere U: ?Sized,
§fn tap_ref<F, R>(self, func: F) -> Selfwhere
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref<F, R>(self, func: F) -> Selfwhere Self: AsRef<T>, F: FnOnce(&T) -> R,
§fn tap_ref_dbg<F, R>(self, func: F) -> Selfwhere
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref_dbg<F, R>(self, func: F) -> Selfwhere Self: AsRef<T>, F: FnOnce(&T) -> R,
tap_ref in debug builds, and does nothing in release builds.§fn tap_ref_mut<F, R>(self, func: F) -> Selfwhere
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut<F, R>(self, func: F) -> Selfwhere Self: AsMut<T>, F: FnOnce(&mut T) -> R,
§fn tap_ref_mut_dbg<F, R>(self, func: F) -> Selfwhere
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Selfwhere Self: AsMut<T>, F: FnOnce(&mut T) -> R,
tap_ref_mut in debug builds, and does nothing in release builds.§impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
impl<T, U> TapBorrow<U> for Twhere U: ?Sized,
§fn tap_borrow<F, R>(self, func: F) -> Selfwhere
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow<F, R>(self, func: F) -> Selfwhere Self: Borrow<T>, F: FnOnce(&T) -> R,
§fn tap_borrow_dbg<F, R>(self, func: F) -> Selfwhere
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow_dbg<F, R>(self, func: F) -> Selfwhere Self: Borrow<T>, F: FnOnce(&T) -> R,
tap_borrow in debug builds, and does nothing in release builds.§fn tap_borrow_mut<F, R>(self, func: F) -> Selfwhere
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Selfwhere Self: BorrowMut<T>, F: FnOnce(&mut T) -> R,
§fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Selfwhere
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Selfwhere Self: BorrowMut<T>, F: FnOnce(&mut T) -> R,
tap_borrow_mut in debug builds, and does nothing in release
builds.§impl<T> TapDeref for T
impl<T> TapDeref for T
§fn tap_deref<F, R>(self, func: F) -> Selfwhere
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref<F, R>(self, func: F) -> Selfwhere Self: Deref, F: FnOnce(&Self::Target) -> R,
self for inspection.§fn tap_deref_dbg<F, R>(self, func: F) -> Selfwhere
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Selfwhere Self: Deref, F: FnOnce(&Self::Target) -> R,
tap_deref in debug builds, and does nothing in release builds.§fn tap_deref_mut<F, R>(self, func: F) -> Selfwhere
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Selfwhere Self: DerefMut, F: FnOnce(&mut Self::Target) -> R,
self for modification.§fn tap_deref_mut_dbg<F, R>(self, func: F) -> Selfwhere
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Selfwhere Self: DerefMut, F: FnOnce(&mut Self::Target) -> R,
tap_deref_mut in debug builds, and does nothing in release
builds.