Skip to main content

Crate thruput_contract_spec

Crate thruput_contract_spec 

Source
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§

ContractArrayType
ContractEnumDef
ContractEnumVariant
ContractEventDef
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.
ContractExceptionType
ContractField
ContractMethodEffect
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.
ContractSignedTokenPreimage
ContractSpec
ContractSpecId
The identity of a user-defined type or event.
ContractSpecInterface
ContractSpecMethod
ContractStructDef
ContractTypeDefKind
ContractTypeInfo
Bundles a type reference for use in contract spec signatures.
ContractTypeKind
ContractUnionCase
ContractUnionCaseKind
Case names carry a UnionCase prefix because enum tags share one namespace, and ContractTypeKind already has Void and Tuple.
ContractUnionDef
ContractVectorType
SpecInterfaceAnchor
SpecInterfaceFragment
SpecMethodFragment
A method belonging to interface_name@interface_version.

Enums§

ContractType
ContractTypeDef
ContractUnionCaseType
SpecFragment

Traits§

ContractEventSpec
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).
ContractTypeName
Provides the spec-visible name for a contract type.
ContractTypeRefSpec
Trait for types that can appear in contract spec signatures. Implemented for primitives, collections, and #[contract_type] types.
ContractTypeSpec
Implemented by #[contract_type] types to provide their spec type definition.

Functions§

symbol
Returns the spec id a ContractTypeSpec type names itself by.
type_ref
Returns the spec type reference for T (e.g. U32, Named("Foo")).

Type Aliases§

ContractSpecString