pub struct GlobalApi {
pub sem_id: SemId,
pub published: bool,
pub convertor: StateConvertor,
pub builder: StateBuilder,
pub raw_convertor: RawConvertor,
pub raw_builder: RawBuilder,
}
Expand description
API for global (immutable, or append-only) state.
API covers two main functions: taking structured data from the user input and building a valid state included in 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 object).
Fields§
§sem_id: SemId
Semantic type id for verifiable part of the state.
published: bool
Whether the state is a published state.
convertor: StateConvertor
Procedure which converts a state made of finite field elements StateValue
into a
structured type StrictVal
.
builder: StateBuilder
Procedure which builds a state in the form of field elements StateValue
out of a
structured type StrictVal
.
raw_convertor: RawConvertor
Procedure which converts a state made of raw bytes [RawState
] into a structured type
StrictVal
.
raw_builder: RawBuilder
Procedure which builds a state in the form of raw bytes [RawState
] out of a structured
type StrictVal
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GlobalApi
impl<'de> Deserialize<'de> for GlobalApi
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 Ord for GlobalApi
impl Ord for GlobalApi
Source§impl PartialOrd for GlobalApi
impl PartialOrd for GlobalApi
Source§impl StrictDecode for GlobalApi
impl StrictDecode for GlobalApi
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for GlobalApi
impl StrictDumb for GlobalApi
fn strict_dumb() -> Self
Source§impl StrictEncode for GlobalApi
impl StrictEncode for GlobalApi
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictStruct for GlobalApi
impl StrictStruct for GlobalApi
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for GlobalApi
impl StrictType for GlobalApi
const STRICT_LIB_NAME: &'static str = LIB_NAME_SONIC
fn strict_name() -> Option<TypeName>
impl Eq for GlobalApi
impl StrictProduct for GlobalApi
impl StructuralPartialEq for GlobalApi
Auto Trait Implementations§
impl Freeze for GlobalApi
impl RefUnwindSafe for GlobalApi
impl Send for GlobalApi
impl Sync for GlobalApi
impl Unpin for GlobalApi
impl UnwindSafe for GlobalApi
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.