Cargo.toml

Overview

Cargo.toml is the manifest file for the Rust package named message-router. It defines the package metadata, versioning, Rust edition, license references, and dependency management configuration. This file is essential for building, compiling, and managing the package's dependencies using Cargo, Rust's package manager and build system.

This manifest is configured to work within a workspace environment, as indicated by the .workspace = true flags on some keys, allowing the package to share configuration and dependencies with other packages in the same workspace.

Sections and Their Purpose

[package] Section

Specifies metadata about the package:

This section ensures the package metadata aligns with the workspace-wide settings for Rust version and licensing.

[dependencies] Section

Lists the external crates (dependencies) required by this package at runtime and compile time. Dependencies with .workspace = true indicate that their versions and sources are managed at the workspace level, allowing for consistent dependency resolution across multiple packages.

Key dependencies include:

Additionally, the dependency:

[dev-dependencies] Section

Defines dependencies used exclusively during development or testing:

Important Implementation Details

Interaction with Other Parts of the System

Visual Diagram

flowchart TD
Package[message-router Package]
Package --> Metadata[Package Metadata]
Metadata --> Name["name = message-router"]
Metadata --> Edition["edition = 2021"]
Metadata --> Version["version = 0.1.0"]
Metadata --> RustVersion["rust-version.workspace = true"]
Metadata --> LicenseFile["license-file.workspace = true"]
Package --> Dependencies[Dependencies]
Dependencies --> ActixWeb["actix-web.workspace = true"]
Dependencies --> Anyhow["anyhow.workspace = true"]
Dependencies --> ExtMessagesAuth["ext-messages-auth.workspace = true"]
Dependencies --> Hex["hex.workspace = true"]
Dependencies --> HttpServer["http-server.workspace = true"]
Dependencies --> LazyStatic["lazy_static.workspace = true"]
Dependencies --> ParkingLot["parking_lot.workspace = true"]
Dependencies --> Reqwest["reqwest"]
Reqwest --> ReqwestFeatures["blocking, json, rustls-tls"]
Dependencies --> Serde["serde.workspace = true"]
Dependencies --> SerdeJson["serde_json.workspace = true"]
Dependencies --> TelemetryUtils["telemetry_utils.workspace = true"]
Dependencies --> Tracing["tracing.workspace = true"]
Dependencies --> TvmTypes["tvm_types.workspace = true"]
Dependencies --> Mockall["mockall = 0.13.1"]
Package --> DevDependencies[Dev-Dependencies]
DevDependencies --> ActixRT["actix-rt = 2.10.0"]

This diagram illustrates the hierarchical structure of the Cargo.toml manifest, highlighting the package metadata, dependencies (both workspace-managed and explicitly versioned), and development dependencies. It shows how features are selectively enabled for reqwest.