-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathlib.rs
More file actions
134 lines (108 loc) · 3.94 KB
/
lib.rs
File metadata and controls
134 lines (108 loc) · 3.94 KB
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
#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(missing_docs)]
//! Hydro is a high-level distributed programming framework for Rust.
//! Hydro can help you quickly write scalable distributed services that are correct by construction.
//! Much like Rust helps with memory safety, Hydro helps with [distributed safety](https://hydro.run/docs/hydro/correctness).
//!
//! The core Hydro API involves [live collections](https://hydro.run/docs/hydro/live-collections/), which represent asynchronously
//! updated sources of data such as incoming network requests and application state. The most common live collection is
//! [`live_collections::stream::Stream`]; other live collections can be found in [`live_collections`].
//!
//! Hydro uses a unique compilation approach where you define deployment logic as Rust code alongside your distributed system implementation.
//! For more details on this API, see the [Hydro docs](https://hydro.run/docs/hydro/deploy/) and the [`deploy`] module.
stageleft::stageleft_no_entry_crate!();
#[cfg(feature = "runtime_support")]
#[cfg_attr(docsrs, doc(cfg(feature = "runtime_support")))]
#[doc(hidden)]
pub mod runtime_support {
#[cfg(feature = "sim")]
pub use colored;
pub use {bincode, dfir_rs, stageleft, tokio};
pub mod resource_measurement;
}
#[doc(hidden)]
pub mod macro_support {
pub use copy_span;
}
pub mod prelude {
// taken from `tokio`
//! A "prelude" for users of the `hydro_lang` crate.
//!
//! This prelude is similar to the standard library's prelude in that you'll almost always want to import its entire contents, but unlike the standard library's prelude you'll have to do so manually:
//! ```
//! # #![allow(warnings)]
//! use hydro_lang::prelude::*;
//! ```
//!
//! The prelude may grow over time as additional items see ubiquitous use.
pub use stageleft::q;
pub use crate::compile::builder::FlowBuilder;
pub use crate::live_collections::boundedness::{Bounded, Unbounded};
pub use crate::live_collections::keyed_singleton::KeyedSingleton;
pub use crate::live_collections::keyed_stream::KeyedStream;
pub use crate::live_collections::optional::Optional;
pub use crate::live_collections::singleton::Singleton;
pub use crate::live_collections::sliced::sliced;
pub use crate::live_collections::stream::Stream;
pub use crate::location::{Cluster, External, Location as _, Process, Tick};
pub use crate::networking::TCP;
pub use crate::nondet::{NonDet, nondet};
/// A macro to set up a Hydro crate.
#[macro_export]
macro_rules! setup {
() => {
stageleft::stageleft_no_entry_crate!();
#[cfg(test)]
mod test_init {
#[ctor::ctor]
fn init() {
$crate::compile::init_test();
}
}
};
}
}
#[cfg(feature = "dfir_context")]
#[cfg_attr(docsrs, doc(cfg(feature = "dfir_context")))]
pub mod runtime_context;
pub mod nondet;
pub mod live_collections;
pub mod location;
pub mod networking;
pub mod telemetry;
pub mod tests;
#[cfg(any(
feature = "deploy",
feature = "deploy_integration" // hidden internal feature enabled in the trybuild
))]
#[cfg_attr(docsrs, doc(cfg(feature = "deploy")))]
pub mod deploy;
#[cfg(feature = "sim")]
#[cfg_attr(docsrs, doc(cfg(feature = "sim")))]
pub mod sim;
pub mod forward_handle;
pub mod compile;
mod manual_expr;
#[cfg(feature = "viz")]
#[cfg_attr(docsrs, doc(cfg(feature = "viz")))]
#[expect(missing_docs, reason = "TODO")]
pub mod viz;
mod staging_util;
#[cfg(feature = "deploy")]
#[cfg_attr(docsrs, doc(cfg(feature = "deploy")))]
pub mod test_util;
#[cfg(feature = "build")]
#[ctor::ctor]
fn init_rewrites() {
stageleft::add_private_reexport(
vec!["tokio_util", "codec", "lines_codec"],
vec!["tokio_util", "codec"],
);
}
#[cfg(all(test, feature = "trybuild"))]
mod test_init {
#[ctor::ctor]
fn init() {
crate::compile::init_test();
}
}