mod.rs

Overview

This file serves as a central module aggregator and re-exporter within its parent crate. It organizes and exposes key submodules and their associated types, structs, and handlers related to blockchain set management, message handling, and storage functionalities. By consolidating these exports, mod.rs enables other parts of the application to access these core components through a simplified interface.

The primary responsibilities and functionalities covered by the submodules include:

Modules and Their Purpose

bk_set_summary

Handles the summarization of blockchain sets. This module provides abstractions to create summaries and snapshots of blockchain set data, along with result types and handlers to process these summaries.

bk_set_update

Responsible for blockchain set updates and API-related structures. This module exposes types that allow interaction with API-level blockchain sets, public keys, and status tracking.

boc_by_address

Provides functionalities to retrieve BOC (Bag of Cells) data by blockchain addresses.

default_thread_seqno

Manages thread sequence numbers, typically used for tracking message ordering or thread progress.

ext_messages

Contains logic for handling external messages. This module is declared as pub(crate) indicating internal visibility within the crate.

storage_latest

Manages access to the latest storage state.

Interaction with Other System Parts

This module acts as a façade aggregating submodules that handle different aspects of blockchain data management and messaging. It provides a streamlined interface for other components to:

These components likely interact with networking layers, consensus mechanisms, and storage subsystems in the broader application, though those interactions are managed within each submodule and their handlers.

Key Implementation Details

Usage Example

Other modules can import and use the exposed components as follows:

use crate::mod_name::{BkSetSummaryHandler, ApiBkSetHandler, BocByAddressHandler};

// Create a handler for blockchain set summaries
let summary_handler = BkSetSummaryHandler::new();

// Use the handler to process updates or retrieve summaries
let summary_result = summary_handler.process_summary();

// Similarly, use API handlers
let api_handler = ApiBkSetHandler::new();
let api_snapshot = api_handler.get_snapshot();

// Retrieve BOC data by address
let boc_handler = BocByAddressHandler::new();
let boc_data = boc_handler.get_boc_by_address(address);

Mermaid Diagram

classDiagram
class BkSetSummary {
}
class BkSetSummaryHandler {
+process_summary()
}
class BkSetSummaryResult {
}
class BkSetSummarySnapshot {
}
class BkSummary {
}
class ApiBk {
}
class ApiBkSet {
}
class ApiBkSetHandler {
+process_update()
+get_snapshot()
}
class ApiBkSetSnapshot {
}
class ApiBkStatus {
}
class ApiPubKey {
}
class ApiUInt256 {
}
class BocByAddressHandler {
+get_boc_by_address()
}
class LastSeqnoHandler {
+get_last_seqno()
+update_seqno()
}
class StorageLatestHandler {
+get_latest_state()
+update_latest_state()
}
BkSetSummaryHandler --> BkSetSummary
BkSetSummaryHandler --> BkSetSummaryResult
BkSetSummaryHandler --> BkSetSummarySnapshot
ApiBkSetHandler --> ApiBkSet
ApiBkSetHandler --> ApiBkSetSnapshot
ApiBkSetHandler --> ApiBk
ApiBkSetHandler --> ApiBkStatus
ApiBkSetHandler --> ApiPubKey
ApiBkSetHandler --> ApiUInt256
BocByAddressHandler ..> "BOC Data"
LastSeqnoHandler ..> "Thread Seqno"
StorageLatestHandler ..> "Storage State"

This diagram visualizes the main types and their relationships within this file, focusing on the handlers and their corresponding data structures.