1#![deny(rust_2018_idioms, nonstandard_style, future_incompatible)]
24#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
25#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
26#![cfg_attr(docsrs, feature(doc_auto_cfg))]
27
28#[cfg(doctest)]
29doc_comment::doctest!("../README.md");
30
31mod actor;
32mod address;
33mod context;
34mod context_impl;
35mod context_items;
36mod handler;
37mod mailbox;
38mod stream;
39mod supervisor;
40
41pub mod actors;
42pub mod clock;
43pub mod fut;
44pub mod io;
45pub mod registry;
46pub mod sync;
47pub mod utils;
48
49#[cfg(feature = "macros")]
50pub use actix_derive::{main, test, Message, MessageResponse};
51pub use actix_rt::{spawn, Arbiter, ArbiterHandle, System, SystemRunner};
52
53#[doc(hidden)]
54pub mod __private {
55 #[cfg(feature = "macros")]
56 pub use actix_macros::{main, test};
57}
58
59#[doc(hidden)]
60pub use crate::context::ContextFutureSpawner;
61pub use crate::{
62 actor::{Actor, ActorContext, ActorState, AsyncContext, Running, SpawnHandle, Supervised},
63 address::{Addr, MailboxError, Recipient, WeakAddr, WeakRecipient},
64 context::Context,
65 fut::{
66 ActorFuture, ActorFutureExt, ActorStream, ActorStreamExt, ActorTryFuture,
67 ActorTryFutureExt, WrapFuture, WrapStream,
68 },
69 handler::{
70 ActorResponse, AtomicResponse, Handler, Message, MessageResult, Response,
71 ResponseActFuture, ResponseFuture,
72 },
73 registry::{ArbiterService, Registry, SystemRegistry, SystemService},
74 stream::StreamHandler,
75 supervisor::Supervisor,
76 sync::{SyncArbiter, SyncContext},
77};
78
79pub mod prelude {
80 #[doc(hidden)]
91 #[cfg(feature = "macros")]
92 pub use actix_derive::{Message, MessageResponse};
93 pub use actix_rt::{Arbiter, ArbiterHandle, System, SystemRunner};
94 pub use futures_core::stream::Stream;
95
96 #[allow(deprecated)]
97 pub use crate::utils::Condition;
98 pub use crate::{
99 actor::{Actor, ActorContext, ActorState, AsyncContext, Running, SpawnHandle, Supervised},
100 actors,
101 address::{Addr, MailboxError, Recipient, RecipientRequest, Request, SendError},
102 context::{Context, ContextFutureSpawner},
103 dev, fut,
104 fut::{
105 ActorFuture, ActorFutureExt, ActorStream, ActorStreamExt, ActorTryFuture,
106 ActorTryFutureExt, WrapFuture, WrapStream,
107 },
108 handler::{
109 ActorResponse, AtomicResponse, Handler, Message, MessageResult, Response,
110 ResponseActFuture, ResponseFuture,
111 },
112 io,
113 registry::{ArbiterService, SystemService},
114 stream::StreamHandler,
115 supervisor::Supervisor,
116 sync::{SyncArbiter, SyncContext},
117 utils::{IntervalFunc, TimerFunc},
118 };
119}
120
121pub mod dev {
122 pub use crate::{
133 address::{Envelope, EnvelopeProxy, RecipientRequest, Request, ToEnvelope},
134 prelude::*,
135 };
136 pub mod channel {
137 pub use crate::address::channel::{channel, AddressReceiver, AddressSender};
138 }
139 pub use crate::{
140 context_impl::{AsyncContextParts, ContextFut, ContextParts},
141 handler::{MessageResponse, OneshotSender},
142 mailbox::Mailbox,
143 registry::{Registry, SystemRegistry},
144 };
145}
146
147#[allow(clippy::unit_arg, clippy::needless_doctest_main)]
176pub fn run<R>(f: R) -> std::io::Result<()>
177where
178 R: std::future::Future<Output = ()> + 'static,
179{
180 Ok(actix_rt::System::new().block_on(f))
181}