Cargo.toml

Overview

This file is a manifest configuration file used by the Rust package manager Cargo to define the metadata, dependencies, and configuration of the Rust crate named ext-messages-auth. It specifies the package details, dependencies required for compilation and development, and workspace-related settings to integrate with a multi-package workspace environment.

The primary purpose of this file is to instruct Cargo on how to build and manage the ext-messages-auth crate within the workspace, ensuring that all dependencies are correctly referenced and versioned.


File Structure and Content

The file consists of three main sections:

1. [package]

Defines metadata about the package:

This section is crucial for Cargo to identify the crate and align its configuration with the workspace-wide settings.

2. [dependencies]

Lists all runtime and compile-time dependencies for the crate. Each dependency is specified with the .workspace = true flag, meaning the version and source are managed by the workspace configuration rather than individually within this crate.

Dependencies include:

3. [dev-dependencies]

Lists dependencies required only during development and testing. Here it includes:


Important Implementation Details


Interaction with Other Parts of the System


Visual Diagram of Cargo.toml Structure

flowchart TD
A[Cargo.toml]
A --> B[package]
A --> C[dependencies]
A --> D[dev-dependencies]
B --> B1[name: ext-messages-auth]
B --> B2[version.workspace]
B --> B3[edition.workspace]
B --> B4[rust-version.workspace]
B --> B5[license-file.workspace]
C --> C1[anyhow.workspace]
C --> C2[ed25519-dalek.workspace]
C --> C3[hex.workspace]
C --> C4[lazy_static.workspace]
C --> C5[parking_lot.workspace]
C --> C6[sdk-wrapper.workspace]
C --> C7[serde.workspace]
C --> C8[serde_json.workspace]
C --> C9[tokio.workspace]
C --> C10[tracing.workspace]
C --> C11[tvm_abi.workspace]
C --> C12[tvm_block.workspace]
C --> C13[tvm_client.workspace]
C --> C14[tvm_types.workspace]
D --> D1[rand.workspace]

Usage and Examples

Since Cargo.toml is a configuration file, it is not directly invoked in code but used by Cargo commands:

The workspace inheritance allows all crates within the workspace to share consistent versions and settings, simplifying dependency management and build reproducibility.


Related Topics

See details on package management and workspace configuration at Cargo Package Management and Rust Workspace Configuration.

For dependency versioning and scoped dependencies, refer to Rust Dependency Management.

For details on the TVM-related dependencies, see TON Virtual Machine Architecture.