mod.rs

Overview

This file serves as a module aggregator and re-exporter within its parent module, organizing the project’s core domain entities related to blockchain functionality. It declares four submodules: account, block, message, and transaction. Through selective public re-exports, it exposes key types and structures from these submodules to other parts of the application or external consumers while keeping some internal details restricted to the crate scope.

The purpose of this file is to provide a centralized interface that simplifies imports and usage of the main domain concepts such as accounts, blocks, messages, and transactions, which are fundamental to the operation of the system.

Module Declarations and Re-Exports

Submodules

Public Re-Exports

This design pattern helps encapsulate module internals while providing a clean API surface.

Interaction with Other Parts of the System

Important Implementation Details

Usage Example

use crate::modname::{Account, Block, Message}; // 'modname' to be replaced by actual parent module name

fn process_account(account: &Account) {
    // Access account fields and methods
}

fn create_block() -> Block {
    // Instantiate and return a new block
}

fn handle_message(message: &Message) {
    // Process incoming blockchain message
}

Mermaid Diagram: Module Structure and Re-Exports

classDiagram
class mod_rs {
<<module>>
}
class account {
<<module>>
+Account
}
class block {
<<module>>
+Block
}
class message {
<<module>>
+Message
#AccountMessagesQueryArgs
}
class transaction {
<<module>>
#Transaction
}
mod_rs --> account : pub use Account
mod_rs --> block : pub use Block
mod_rs --> message : pub use Message\npub(crate) use AccountMessagesQueryArgs
mod_rs --> transaction : pub(crate) use Transaction

This diagram illustrates the submodules declared in this file, the key types they define, and how mod.rs re-exports them with different visibility levels. The # symbol indicates crate-level visibility, whereas + indicates public visibility.