pub struct AppendApi<Vm: ApiVm> {
pub sem_id: SemId,
pub raw_sem_id: SemId,
pub published: bool,
pub adaptor: Vm::Adaptor,
}Expand description
API for append-only state.
API covers two main functions: taking structured data from the user input and building a valid state included into a new contract operation - and taking contract state and converting it into a user-friendly form, as a structured data (which may be lately used by readers performing aggregation of state into a collection-type objects).
Fields§
§sem_id: SemIdSemantic type id for verifiable part of the state.
raw_sem_id: SemIdSemantic type id for non-verifiable part of the state.
published: bool§adaptor: Vm::AdaptorProcedures which convert a state made of finite field elements StateData into a
structured type [StructData] and vice verse.
Implementations§
Source§impl<Vm: ApiVm> AppendApi<Vm>
impl<Vm: ApiVm> AppendApi<Vm>
pub fn convert(&self, data: &StateData, sys: &TypeSystem) -> Option<StateAtom>
Sourcepub fn build(
&self,
value: StrictVal,
raw: Option<StrictVal>,
sys: &TypeSystem,
) -> StateData
pub fn build( &self, value: StrictVal, raw: Option<StrictVal>, sys: &TypeSystem, ) -> StateData
Build an immutable memory cell out of structured state.
Since append-only state includes both field elements (verifiable part of the state) and optional structured data (non-verifiable, non-compressible part of the state) it takes two inputs of a structured state data, leaving the raw part unchanged.
Trait Implementations§
Source§impl<'de, Vm: ApiVm> Deserialize<'de> for AppendApi<Vm>where
Vm::Adaptor: Deserialize<'de>,
impl<'de, Vm: ApiVm> Deserialize<'de> for AppendApi<Vm>where
Vm::Adaptor: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<Vm: Ord + ApiVm> Ord for AppendApi<Vm>
impl<Vm: Ord + ApiVm> Ord for AppendApi<Vm>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<Vm: PartialOrd + ApiVm> PartialOrd for AppendApi<Vm>where
Vm::Adaptor: PartialOrd,
impl<Vm: PartialOrd + ApiVm> PartialOrd for AppendApi<Vm>where
Vm::Adaptor: PartialOrd,
Source§impl<Vm: ApiVm> StrictDecode for AppendApi<Vm>
impl<Vm: ApiVm> StrictDecode for AppendApi<Vm>
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl<Vm: ApiVm> StrictDumb for AppendApi<Vm>
impl<Vm: ApiVm> StrictDumb for AppendApi<Vm>
fn strict_dumb() -> Self
Source§impl<Vm: ApiVm> StrictEncode for AppendApi<Vm>
impl<Vm: ApiVm> StrictEncode for AppendApi<Vm>
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl<Vm: ApiVm> StrictStruct for AppendApi<Vm>
impl<Vm: ApiVm> StrictStruct for AppendApi<Vm>
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl<Vm: ApiVm> StrictType for AppendApi<Vm>
impl<Vm: ApiVm> StrictType for AppendApi<Vm>
const STRICT_LIB_NAME: &'static str = LIB_NAME_SONIC
fn strict_name() -> Option<TypeName>
impl<Vm: Eq + ApiVm> Eq for AppendApi<Vm>
impl<Vm: ApiVm> StrictProduct for AppendApi<Vm>
impl<Vm: ApiVm> StructuralPartialEq for AppendApi<Vm>
Auto Trait Implementations§
impl<Vm> Freeze for AppendApi<Vm>
impl<Vm> RefUnwindSafe for AppendApi<Vm>
impl<Vm> Send for AppendApi<Vm>
impl<Vm> Sync for AppendApi<Vm>
impl<Vm> Unpin for AppendApi<Vm>
impl<Vm> UnwindSafe for AppendApi<Vm>
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.