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
//! Commands for performing asynchronous side effects and returning runtime
//! directives.
//!
//! Commands represent asynchronous operations that produce messages or actions,
//! plus attributes that tell the runtime how to handle the update that returned
//! them. They are the primary way to perform side effects in the Elm
//! Architecture, such as HTTP requests, file I/O, or any other async operation.
//!
//! # Examples
//!
//! ```
//! use tears::prelude::*;
//!
//! enum Message {
//! DataLoaded(String),
//! }
//!
//! async fn load_data() -> String {
//! // Perform async operation
//! "data".to_string()
//! }
//!
//! // Create a command that performs an async operation
//! let cmd = Command::perform(load_data(), Message::DataLoaded);
//! ```
pub
pub use CancellableCommand;
pub use ;
pub use Command;
pub use ;
pub use RuntimeCommandParts;
/// An internal runtime directive produced by a command's effect stream.
///
/// This type is not part of the public API. Use
/// [`Command::message`](crate::Command::message) and
/// [`Command::quit`](crate::Command::quit) to construct the corresponding
/// commands.
pub