pub struct StateData {
pub value: StateValue,
pub raw: Option<RawData>,
}
Expand description
State kept in the immutable (read-only) memory cells.
Fields§
§value: StateValue
The verifiable and compressible part of the state, in the form of field elements.
raw: Option<RawData>
Optional raw state, which cannot be accessed by the verification scripts and zk-AluVM, and are not compressible as a part of zk proofs.
Implementations§
Source§impl StateData
impl StateData
Sourcepub fn new(ty: impl Into<fe256>, val: impl Into<fe256>) -> StateData
pub fn new(ty: impl Into<fe256>, val: impl Into<fe256>) -> StateData
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.
Leaves raw data empty.
Sourcepub fn with_raw(
ty: impl Into<fe256>,
val: impl Into<fe256>,
raw: impl Into<RawData>,
) -> StateData
pub fn with_raw( ty: impl Into<fe256>, val: impl Into<fe256>, raw: impl Into<RawData>, ) -> StateData
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.
Adds to that value raw data.
Trait Implementations§
Source§impl CommitEncode for StateData
impl CommitEncode for StateData
Source§type CommitmentId = MerkleHash
type CommitmentId = MerkleHash
Source§fn commit_encode(&self, e: &mut CommitEngine)
fn commit_encode(&self, e: &mut CommitEngine)
std::io::Write
writer instanceSource§impl<'de> Deserialize<'de> for StateData
impl<'de> Deserialize<'de> for StateData
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StateData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StateData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for StateData
impl Serialize for StateData
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,
Source§impl StrictDecode for StateData
impl StrictDecode for StateData
fn strict_decode(reader: &mut impl TypedRead) -> Result<StateData, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for StateData
impl StrictDumb for StateData
fn strict_dumb() -> StateData
Source§impl StrictEncode for StateData
impl StrictEncode for StateData
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictStruct for StateData
impl StrictStruct for StateData
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for StateData
impl StrictType for StateData
const STRICT_LIB_NAME: &'static str = LIB_NAME_ULTRASONIC
fn strict_name() -> Option<TypeName>
impl Eq for StateData
impl StrictProduct for StateData
impl StructuralPartialEq for StateData
Auto Trait Implementations§
impl Freeze for StateData
impl RefUnwindSafe for StateData
impl Send for StateData
impl Sync for StateData
impl Unpin for StateData
impl UnwindSafe for StateData
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<T> CommitId for Twhere
T: CommitEncode,
impl<T> CommitId for Twhere
T: CommitEncode,
fn commit(&self) -> CommitEngine
Source§fn commit_id(&self) -> <T as CommitEncode>::CommitmentId
fn commit_id(&self) -> <T as CommitEncode>::CommitmentId
Source§impl<T> CommitmentLayout for Twhere
T: CommitEncode + StrictDumb,
impl<T> CommitmentLayout for Twhere
T: CommitEncode + StrictDumb,
Source§fn commitment_layout() -> CommitLayout
fn commitment_layout() -> CommitLayout
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.