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
//! # Sonic Channel
//! Rust client for [sonic] search backend.
//!
//!
//! ## Example usage
//!
//! ### Search channel
//!
//! Note: This example requires enabling the `search` feature, enabled by default.
//!
//! ```rust,no_run
//! use sonic_channel::*;
//!
//! fn main() -> result::Result<()> {
//! let channel = SearchChannel::start(
//! "localhost:1491",
//! "SecretPassword",
//! )?;
//!
//! let objects = channel.query(QueryRequest::new(
//! Dest::col_buc("collection", "bucket"),
//! "recipe",
//! ))?;
//! dbg!(objects);
//!
//! Ok(())
//! }
//! ```
//!
//! ### Ingest channel
//!
//! Note: This example requires enabling the `ingest` feature.
//!
//! ```rust,no_run
//! use sonic_channel::*;
//!
//! fn main() -> result::Result<()> {
//! let channel = IngestChannel::start(
//! "localhost:1491",
//! "SecretPassword",
//! )?;
//!
//! let dest = Dest::col_buc("collection", "bucket").obj("object:1");
//! let pushed = channel.push(PushRequest::new(dest, "my best recipe"))?;
//! // or
//! // let pushed = channel.push(
//! // PushRequest::new(dest, "Мой лучший рецепт").lang(Lang::Rus)
//! // )?;
//! dbg!(pushed);
//!
//! Ok(())
//! }
//! ```
//!
//! ### Control channel
//!
//! Note: This example requires enabling the `control` feature.
//!
//! ```rust,no_run
//! use sonic_channel::*;
//!
//! fn main() -> result::Result<()> {
//! let channel = ControlChannel::start(
//! "localhost:1491",
//! "SecretPassword",
//! )?;
//!
//! let result = channel.consolidate()?;
//! assert_eq!(result, ());
//!
//! Ok(())
//! }
//! ```
//!
//! [sonic]: https://github.com/valeriansaliou/sonic
// Rustc lints.
// Clippy lints
compile_error!;
pub
/// Contains the request parameters for each command to the sonic server.
/// Contains sonic channel error type and custom Result type for easy configure your functions.
pub use *;
pub use *;
pub use *;
pub use Lang;