1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/*
* Copyright (c) 2024. Govcraft
*
* Licensed under either of
* * Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* * MIT license: http://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the applicable License for the specific language governing permissions and
* limitations under that License.
*/
// Keep this to enforce coverage
//! # Acton Reactive
//!
//! This crate provides the foundational components for the Acton asynchronous
//! actor system, built on top of Tokio. It establishes a robust, message-passing
//! framework with clear separation of concerns for actor state, runtime management,
//! communication, and lifecycle.
//!
//! ## Key Concepts
//!
//! - **Actors (`ManagedActor`)**: Core computational units wrapping user-defined state
//! and logic, managed by the runtime.
//! - **Handles (`ActorHandle`)**: External references for interacting with actors
//! (sending messages, stopping, supervising).
//! - **Messaging**: Asynchronous communication via Tokio MPSC channels, using
//! messages implementing the `ActonMessage` trait.
//! - **Broker (`Broker`)**: Central publish-subscribe mechanism for topic-based
//! message distribution.
//! - **Lifecycle & Supervision**: Type-state pattern (`Idle`, `Started`) for actors,
//! lifecycle hooks, and hierarchical supervision.
//! - **Runtime (`ActorRuntime`)**: Manages the overall system, including actor
//! creation and shutdown.
//! - **Traits**: Core interfaces (`ActorHandleInterface`, `Broker`, `Subscriber`, etc.)
//! define the framework's capabilities.
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! use acton_reactive::prelude::*;
//!
//! #[acton_message]
//! struct MyMessage {
//! content: String,
//! }
//! ```
/// Internal utilities and structures used throughout the Acton framework.
pub
/// Defines the core actor structures and logic.
pub
/// Defines message types and envelopes used for communication.
pub
/// Defines core traits used throughout the Acton framework.
pub
/// IPC (Inter-Process Communication) module for external process integration.
///
/// This module provides Unix Domain Socket communication infrastructure for
/// sending messages to actors from external processes.
///
/// This module provides all the public IPC types and functions for building
/// IPC clients and working with the IPC infrastructure.
///
/// # Feature Gate
///
/// This module is only available when the `ipc` feature is enabled.
/// A prelude module for conveniently importing the most commonly used items.
///
/// This module re-exports essential types, traits, and macros from the Acton
/// framework and dependencies like `acton-ern` and `async-trait`, simplifying
/// the import process for users.
///
/// # Re-exports
///
/// ## Macros (from `acton-macro`)
/// * [`acton_macro::acton_message`]: Attribute macro for defining Acton messages.
/// * [`acton_macro::acton_actor`]: Attribute macro for defining Acton actors.
///
/// ## External Crates
/// * [`acton_ern::*`](https://docs.rs/acton-ern): All items from the `acton-ern` crate for unique resource naming.
/// * [`async_trait::async_trait`](https://docs.rs/async-trait/latest/async_trait/attr.async_trait.html): The macro for defining async functions in traits.
///
/// ## Core Types
/// * [`crate::actor::ActorConfig`]: Configuration for creating new actors.
/// * [`crate::actor::Idle`]: Type-state marker for an actor before it starts.
/// * [`crate::actor::ManagedActor`]: The core actor structure managing state and runtime.
/// * [`crate::actor::Started`]: Type-state marker for a running actor.
/// * [`crate::common::ActonApp`]: Entry point for initializing the Acton system.
/// * [`crate::common::Broker`]: The central message broker implementation.
/// * [`crate::common::ActorHandle`]: Handle for interacting with an actor.
/// * [`crate::common::Reply`]: Utility for creating standard message handler return types.
/// * [`crate::common::ActorRuntime`]: Represents the initialized Acton runtime.
/// * [`crate::message::BrokerRequest`]: Wrapper for messages intended for broadcast.
/// * [`crate::message::BrokerRequestEnvelope`]: Specialized envelope for broadcast messages.
/// * [`crate::message::MessageAddress`]: Addressable endpoint of an actor.
/// * [`crate::message::OutboundEnvelope`]: Represents a message prepared for sending.
/// * [`crate::traits::ActonMessage`]: Marker trait for all valid messages.
/// * [`crate::traits::ActorHandleInterface`]: Core trait defining actor interaction methods.
/// * [`crate::traits::Broker`]: Trait defining message broadcasting capabilities.
/// * [`crate::traits::Subscribable`]: Trait for managing message subscriptions.
/// * [`crate::traits::Subscriber`]: Trait for accessing the message broker.
///
/// ## IPC Types (requires `ipc` feature)
/// * [`crate::common::ipc::IpcTypeRegistry`]: Registry for IPC message type deserialization.
/// * [`crate::common::ipc::IpcEnvelope`]: Envelope format for IPC messages.
/// * [`crate::common::ipc::IpcResponse`]: Response envelope format for IPC.
/// * [`crate::common::ipc::IpcError`]: Error types for IPC operations.
/// * [`crate::common::ipc::IpcConfig`]: Configuration for IPC listener.
/// * [`crate::common::ipc::IpcListenerHandle`]: Handle for managing IPC listener lifecycle.
/// * [`crate::common::ipc::IpcListenerStats`]: Statistics for IPC listener.