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
//! # HyperCPU
//!
//! HyperCPU is a library for creating and running
//! any kind of calculation across instances. It
//! allows you to share your calculation logic
//! across threads, processes, and even machines.
//!
//! At the core of HyperCPU is the [`Moment`] trait.
//! A `Moment` is a unit of work that can be
//! resolved into a value. The `resolve` method
//! is asynchronous, so values do not need to be
//! immediately available.
//!
//! Thanks to the logic behind a `Moment`, calculations
//! can be stacked without resolution. This allows
//! machines to resolve values in parallel, even
//! when they depend on each other.
use Error;
use async_trait;
/// Provides types and traits for converting between `Moment`s.
///
/// This module is almost always required when using HyperCPU.
/// It provides the [`Convert`] and [`TryConvert`] traits,
/// which allow you to convert between `Moment`s of different
/// value types.
/// Provides types and traits for various operations on `Moment`s.
///
/// This module is almost always required when using HyperCPU.
/// It provides the standard arithmetic and logical operators
/// for `Moment`s.
/// Provides conditional logic for `Moment`s.
///
/// This module is not in the prelude, but is still
/// a common requirement for HyperCPU. It provides
/// the [`If`] struct, which allows you to branch
/// calculations based on a condition.
/// Provides easy construction of `Moment`s.
///
/// This module provides the [`Value`] struct,
/// which uses operator overloading to allow
/// you to easily construct `Moment`s.
/// Provides the HyperCPU prelude.
/// A unit of work that can be resolved into a value.
///
/// Any type that implements `Moment` can be stacked with
/// other `Moment`s to create a calculation. The calculation
/// can be resolved in parallel, even when the `Moment`s
/// depend on the output of each other.
literal_moments!;