pub struct Semantics {
pub version: u16,
pub default: Api,
pub custom: SmallOrdMap<TypeName, Api>,
pub codex_libs: SmallOrdSet<Lib>,
pub api_libs: SmallOrdSet<Lib>,
pub types: TypeSystem,
}
Expand description
A helper structure to store the contract semantics, made of a set of APIs, corresponding type system, and libs, used by the codex.
A contract may have multiple APIs defined; this structure summarizes information about them. The structure also holds a set of AluVM libraries for the codex and type system used by the APIs.
Fields§
§version: u16
Backward-compatible version number for the issuer.
This version number is used to decide which contract APIs to apply if multiple contract APIs are available.
default: Api
The default API.
custom: SmallOrdMap<TypeName, Api>
The custom named APIs.
The mechanism of the custom APIs allows a contract to have multiple implementations of the same interface.
For instance, a contract may provide multiple tokens using different token names.
codex_libs: SmallOrdSet<Lib>
A set of zk-AluVM libraries called from the contract codex.
api_libs: SmallOrdSet<Lib>
A set of AluVM libraries called from the APIs.
types: TypeSystem
The type system used by the contract APIs.
Implementations§
Source§impl Semantics
impl Semantics
pub fn apis_checksum(&self) -> ApisChecksum
Trait Implementations§
Source§impl CommitEncode for Semantics
impl CommitEncode for Semantics
Source§type CommitmentId = ApisChecksum
type CommitmentId = ApisChecksum
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 Semantics
impl<'de> Deserialize<'de> for Semantics
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 Semantics
impl Ord for Semantics
Source§impl PartialOrd for Semantics
impl PartialOrd for Semantics
Source§impl StrictDecode for Semantics
impl StrictDecode for Semantics
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for Semantics
impl StrictDumb for Semantics
fn strict_dumb() -> Self
Source§impl StrictEncode for Semantics
impl StrictEncode for Semantics
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictStruct for Semantics
impl StrictStruct for Semantics
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for Semantics
impl StrictType for Semantics
const STRICT_LIB_NAME: &'static str = LIB_NAME_SONIC
fn strict_name() -> Option<TypeName>
impl Eq for Semantics
impl StrictProduct for Semantics
Auto Trait Implementations§
impl Freeze for Semantics
impl RefUnwindSafe for Semantics
impl Send for Semantics
impl Sync for Semantics
impl Unpin for Semantics
impl UnwindSafe for Semantics
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> 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.