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
//! A wrapper for the [Croc] binary.
//! Set up the binary using builders and listen to events through streams.
//!
//! [Croc]: https://github.com/schollz/croc
//!
//! # Usage example
//!
//! ```no_run,standalone_crate
//! # use croc_sidecar::Croc;
//! fn main() -> croc_sidecar::Result {
//! let croc = Croc::new()
//! .send()
//! .code("my-custom-code")
//! .file("/path/to/file.rs")
//! .spawn()?;
//! # Ok(())
//! }
//! ```
//!
//! To receive a file using a code:
//!
//! ```no_run,standalone_crate
//! # use croc_sidecar::Croc;
//! fn main() -> croc_sidecar::Result {
//! let croc = Croc::new()
//! .receive()
//! .spawn("my-custom-code")?;
//! # Ok(())
//! }
//! ```
//!
//! You can also listen to `events`:
//!
//! ```no_run,standalone_crate
//! # use futures_util::StreamExt;
//! # use croc_sidecar::Croc;
//! # #[tokio::main]
//! # async fn main() -> croc_sidecar::Result {
//! let mut croc = Croc::new().send().file("file.rs").spawn()?;
//!
//! let mut stream = croc.events()?;
//! while let Some(event) = stream.next().await {
//! match event {
//! croc_sidecar::CrocEvent::CodeGenerated(code) => println!("Code is: {code}"),
//! croc_sidecar::CrocEvent::Hashing(progress) => println!("Hashing: {}%", progress.percentage),
//! croc_sidecar::CrocEvent::Sending(progress) => println!("Sending: {}%", progress.percentage),
//! _ => {}
//! }
//! }
//! # Ok(())
//! # }
//! ```
pub use Croc;
pub use CrocChild;
pub use CrocEvent;
pub use ;
pub use CrocParser;
pub use CrocEventStream;