mod.rs

Overview

This file defines the ThreadMessageQueueState structure and its associated implementations which represent the state of a message queue for threads, keyed by account addresses. It manages a collection of message inboxes per account and tracks the ordering of these accounts for message processing. The file also exposes builders and utilities related to constructing and manipulating the message queue state, particularly through diffs and ordered sets.

The primary focus is managing and querying the messages associated with accounts in a thread-safe, ordered manner, facilitating incremental updates and retrievals of messages for specific accounts.

Modules

Structs and Implementations

ThreadMessageQueueState

This struct encapsulates the state of a thread message queue.

Fields

Traits Implemented

Methods

Implementation Details and Algorithms

Interactions with Other Parts of the System

Diagram

classDiagram
class ThreadMessageQueueState {
+messages: BTreeMap
-order_set: OrderSet
-cursor: usize
+empty()
+account_inbox()
+build_next()
+length()
+destinations()
}
ThreadMessageQueueState ..> AccountAddress : uses
ThreadMessageQueueState ..> AccountInbox : uses
ThreadMessageQueueState ..> order_set::OrderSet : contains
ThreadMessageQueueState ..> diff::ThreadMessageQueueStateDiff : uses builder

This diagram shows the main ThreadMessageQueueState struct, its key fields, and primary methods, as well as its relationships with AccountAddress, AccountInbox, the OrderSet for ordering, and the ThreadMessageQueueStateDiff for building updated states.