Expand description
The contract spec model shared by the macros, the SDK and spec tooling.
It defines the traits through which contract types and events describe
themselves (ContractTypeSpec, ContractEventSpec,
ContractTypeName), zero-copy views of spec fragments, and the raw spec
section’s wire-format versioning (format). With the owned-model
feature it also re-exports the owned spec types from thruput-spec.
Re-exports§
pub use format::FINAL_SECTION_NAME;pub use format::RAW_SECTION_NAME;pub use format::RAW_SECTION_PREFIX;pub use format::RAW_SPEC_FORMAT;pub use format::SpecSection;pub use format::classify_section;pub use view::*;
Modules§
- format
- Wire-format versioning for the raw spec ELF section.
- view
- Borrowed/const equivalents of the model types.
Structs§
- Contract
Array Type - Contract
Enum Def - Contract
Enum Variant - Contract
Event Def - Describes an event emitted via the LogEvent syscall (see event.x). Topic 0 is always the event signature: sha256(MAJOR_VERSION :: CRATE_NAME :: TYPE_NAME) Topic fields and payload fields are listed separately, each in declaration order. Topic values that are not already 32 bytes wide are XDR-encoded and sha256-hashed; payload fields are XDR-encoded in order to form the event data.
- Contract
Exception Type - Contract
Field - Contract
Method Effect - Author-declared effects of the whole invocation, including nested calls. These declarations are not compiler or runtime guarantees. They do not select an execution path, change entrypoint IDs, or guarantee success. Application effects include storage deltas, events, transfers and deployment.
- Contract
Signed Token Preimage - Contract
Spec - Contract
Spec Id - The identity of a user-defined type or event.
- Contract
Spec Interface - Contract
Spec Method - Contract
Struct Def - Contract
Type DefKind - Contract
Type Info - Bundles a type reference for use in contract spec signatures.
- Contract
Type Kind - Contract
Union Case - Contract
Union Case Kind - Case names carry a
UnionCaseprefix because enum tags share one namespace, and ContractTypeKind already hasVoidandTuple. - Contract
Union Def - Contract
Vector Type - Spec
Interface Anchor - Spec
Interface Fragment - Spec
Method Fragment - A method belonging to
interface_name@interface_version.
Enums§
Traits§
- Contract
Event Spec - Implemented by
#[derive(Event)]types to provide their spec event definition. The definition is emitted into the raw spec section only where the event is declared (emits(...)on an interface) or exported (#[event_spec(export)]on the derive). - Contract
Type Name - Provides the spec-visible name for a contract type.
- Contract
Type RefSpec - Trait for types that can appear in contract spec signatures.
Implemented for primitives, collections, and
#[contract_type]types. - Contract
Type Spec - Implemented by
#[contract_type]types to provide their spec type definition.
Functions§
- symbol
- Returns the spec id a
ContractTypeSpectype names itself by. - type_
ref - Returns the spec type reference for
T(e.g.U32,Named("Foo")).