pub enum StateValue {
None,
Single {
first: fe256,
},
Double {
first: fe256,
second: fe256,
},
Triple {
first: fe256,
second: fe256,
third: fe256,
},
Quadruple {
first: fe256,
second: fe256,
third: fe256,
fourth: fe256,
},
}
Expand description
A value stored in a single memory cell.
Variants§
None
A unit value.
Single
A single 256-bit field element.
Double
A tuple of two 256-bit field elements.
Triple
A tuple of three 256-bit field elements.
Quadruple
A tuple of four 256-bit field elements.
Implementations§
Source§impl StateValue
impl StateValue
Sourcepub fn new(ty: impl Into<fe256>, val: impl Into<fe256>) -> StateValue
pub fn new(ty: impl Into<fe256>, val: impl Into<fe256>) -> StateValue
Constructs a new state value in StateValue::Double
form, using the first element to
store the value “type” from the first argument, and the second argument to store the data,
which can be anything representable with a single 256-bit field element.
Trait Implementations§
Source§impl Clone for StateValue
impl Clone for StateValue
Source§fn clone(&self) -> StateValue
fn clone(&self) -> StateValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StateValue
impl Debug for StateValue
Source§impl Default for StateValue
impl Default for StateValue
Source§fn default() -> StateValue
fn default() -> StateValue
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StateValue
impl<'de> Deserialize<'de> for StateValue
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StateValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StateValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromIterator<fe256> for StateValue
impl FromIterator<fe256> for StateValue
Source§fn from_iter<T>(iter: T) -> StateValuewhere
T: IntoIterator<Item = fe256>,
fn from_iter<T>(iter: T) -> StateValuewhere
T: IntoIterator<Item = fe256>,
Creates a value from an iterator. Read more
Source§impl FromIterator<u256> for StateValue
impl FromIterator<u256> for StateValue
Source§fn from_iter<T>(iter: T) -> StateValuewhere
T: IntoIterator<Item = u256>,
fn from_iter<T>(iter: T) -> StateValuewhere
T: IntoIterator<Item = u256>,
Creates a value from an iterator. Read more
Source§impl Hash for StateValue
impl Hash for StateValue
Source§impl IntoIterator for StateValue
impl IntoIterator for StateValue
Source§impl PartialEq for StateValue
impl PartialEq for StateValue
Source§impl Serialize for StateValue
impl Serialize for StateValue
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl StrictDecode for StateValue
impl StrictDecode for StateValue
fn strict_decode(reader: &mut impl TypedRead) -> Result<StateValue, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictEncode for StateValue
impl StrictEncode for StateValue
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictSum for StateValue
impl StrictSum for StateValue
const ALL_VARIANTS: &'static [(u8, &'static str)]
fn variant_name(&self) -> &'static str
fn strict_check_variants()
fn variant_name_by_tag(tag: u8) -> Option<VariantName>
fn variant_ord(&self) -> u8
Source§impl StrictType for StateValue
impl StrictType for StateValue
const STRICT_LIB_NAME: &'static str = LIB_NAME_ULTRASONIC
fn strict_name() -> Option<TypeName>
Source§impl StrictUnion for StateValue
impl StrictUnion for StateValue
fn strict_type_info() -> TypeInfo<Self>
impl Copy for StateValue
impl Eq for StateValue
impl StructuralPartialEq for StateValue
Auto Trait Implementations§
impl Freeze for StateValue
impl RefUnwindSafe for StateValue
impl Send for StateValue
impl Sync for StateValue
impl Unpin for StateValue
impl UnwindSafe for StateValue
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
Mutably borrows from an owned value. Read more
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
Compare self to
key
and return true
if they are equal.