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<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<UnbondingPurse>)
Variant that stores unbonding information.
Implementations
sourceimpl 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<UnbondingPurse>>
pub fn as_withdraw(&self) -> Option<&Vec<UnbondingPurse>>
Returns a wrapped list of UnbondingPurse
s if this is a Withdraw
variant.
Trait Implementations
sourceimpl Clone for StoredValue
impl Clone for StoredValue
sourcefn clone(&self) -> StoredValue
fn clone(&self) -> StoredValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for StoredValue
impl Debug for StoredValue
sourceimpl<'de> Deserialize<'de> for StoredValue
impl<'de> Deserialize<'de> for StoredValue
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<Account> for StoredValue
impl From<Account> for StoredValue
sourcefn from(value: Account) -> StoredValue
fn from(value: Account) -> StoredValue
Converts to this type from the input type.
sourceimpl From<Bid> for StoredValue
impl From<Bid> for StoredValue
sourcefn from(bid: Bid) -> StoredValue
fn from(bid: Bid) -> StoredValue
Converts to this type from the input type.
sourceimpl From<CLValue> for StoredValue
impl From<CLValue> for StoredValue
sourcefn from(value: CLValue) -> StoredValue
fn from(value: CLValue) -> StoredValue
Converts to this type from the input type.
sourceimpl From<Contract> for StoredValue
impl From<Contract> for StoredValue
sourcefn from(value: Contract) -> StoredValue
fn from(value: Contract) -> StoredValue
Converts to this type from the input type.
sourceimpl From<ContractPackage> for StoredValue
impl From<ContractPackage> for StoredValue
sourcefn from(value: ContractPackage) -> StoredValue
fn from(value: ContractPackage) -> StoredValue
Converts to this type from the input type.
sourceimpl From<ContractWasm> for StoredValue
impl From<ContractWasm> for StoredValue
sourcefn from(value: ContractWasm) -> StoredValue
fn from(value: ContractWasm) -> StoredValue
Converts to this type from the input type.
sourceimpl FromBytes for StoredValue
impl FromBytes for StoredValue
sourceimpl PartialEq<StoredValue> for StoredValue
impl PartialEq<StoredValue> for StoredValue
sourcefn eq(&self, other: &StoredValue) -> bool
fn eq(&self, other: &StoredValue) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &StoredValue) -> bool
fn ne(&self, other: &StoredValue) -> bool
This method tests for !=
.
sourceimpl Serialize for StoredValue
impl Serialize for StoredValue
sourceimpl ToBytes for StoredValue
impl ToBytes for StoredValue
sourcefn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Returns the length of the 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. Read more
sourceimpl TryFrom<StoredValue> for CLValue
impl TryFrom<StoredValue> for CLValue
type Error = TypeMismatch
type Error = TypeMismatch
The type returned in the event of a conversion error.
sourcefn try_from(stored_value: StoredValue) -> Result<Self, Self::Error>
fn try_from(stored_value: StoredValue) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<StoredValue> for Account
impl TryFrom<StoredValue> for Account
type Error = TypeMismatch
type Error = TypeMismatch
The type returned in the event of a conversion error.
sourcefn try_from(stored_value: StoredValue) -> Result<Self, Self::Error>
fn try_from(stored_value: StoredValue) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<StoredValue> for ContractWasm
impl TryFrom<StoredValue> for ContractWasm
type Error = TypeMismatch
type Error = TypeMismatch
The type returned in the event of a conversion error.
sourcefn try_from(stored_value: StoredValue) -> Result<Self, Self::Error>
fn try_from(stored_value: StoredValue) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<StoredValue> for ContractPackage
impl TryFrom<StoredValue> for ContractPackage
type Error = TypeMismatch
type Error = TypeMismatch
The type returned in the event of a conversion error.
sourcefn try_from(stored_value: StoredValue) -> Result<Self, Self::Error>
fn try_from(stored_value: StoredValue) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<StoredValue> for Contract
impl TryFrom<StoredValue> for Contract
type Error = TypeMismatch
type Error = TypeMismatch
The type returned in the event of a conversion error.
sourcefn try_from(stored_value: StoredValue) -> Result<Self, Self::Error>
fn try_from(stored_value: StoredValue) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<StoredValue> for Transfer
impl TryFrom<StoredValue> for Transfer
type Error = TypeMismatch
type Error = TypeMismatch
The type returned in the event of a conversion error.
sourcefn try_from(value: StoredValue) -> Result<Self, Self::Error>
fn try_from(value: StoredValue) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<StoredValue> for DeployInfo
impl TryFrom<StoredValue> for DeployInfo
type Error = TypeMismatch
type Error = TypeMismatch
The type returned in the event of a conversion error.
sourcefn try_from(value: StoredValue) -> Result<Self, Self::Error>
fn try_from(value: StoredValue) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<StoredValue> for EraInfo
impl TryFrom<StoredValue> for EraInfo
type Error = TypeMismatch
type Error = TypeMismatch
The type returned in the event of a conversion error.
sourcefn try_from(value: StoredValue) -> Result<Self, Self::Error>
fn try_from(value: StoredValue) -> Result<Self, Self::Error>
Performs the conversion.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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,
Causes 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,
Causes self
to use its Display
implementation when
Debug
-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self
to use its LowerExp
implementation when
Debug
-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self
to use its LowerHex
implementation when
Debug
-formatted. Read more
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Causes 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,
Causes self
to use its Pointer
implementation when
Debug
-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self
to use its UpperExp
implementation when
Debug
-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self
to use its UpperHex
implementation when
Debug
-formatted. Read more
impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
impl<T> PipeDeref for T
impl<T> PipeDeref for T
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a dereference into a function that cannot normally be called in suffix position. Read more
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more
impl<T> PipeRef for T
impl<T> PipeRef for T
impl<T> Tap for T
impl<T> Tap for T
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
Provides immutable access for inspection. Read more
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
Calls tap
in debug builds, and does nothing in release builds.
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Provides mutable access for modification. Read more
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Calls tap_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the reference for inspection.
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Calls tap_ref
in debug builds, and does nothing in release builds.
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the reference for modification.
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_ref_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the borrow for inspection. Read more
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Calls tap_borrow
in debug builds, and does nothing in release builds.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_borrow_mut
in debug builds, and does nothing in release
builds. Read more
impl<T> TapDeref for T
impl<T> TapDeref for T
fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Immutably dereferences self
for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref
in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self
for modification.
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Calls tap_deref_mut
in debug builds, and does nothing in release
builds. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more