Rust client for [sonic] search backend.
We recommend you start with the [documentation].
Add sonic-channel = { version = "0.1" }
as a dependency in Cargo.toml
.
Cargo.toml
example:
```toml [package] name = "my-crate" version = "0.1.0" authors = ["Me user@rust-lang.org"]
[dependencies] sonic-channel = { version = "0.1.0-rc3" } ```
```rust use sonic_channel::*;
fn main() -> result::Result<()> { let mut channel = SonicChannel::connect("localhost:1491")?;
channel.start(ChannelMode::Search, "SecretPassword")?;
let objects = channel.query("collection", "bucket", "recipe")?;
dbg!(objects);
Ok(())
} ```
```rust use sonic_channel::*;
fn main() -> result::Result<()> { let mut channel = SonicChannel::connect("localhost:1491")?;
channel.start(ChannelMode::Ingest, "SecretPassword")?;
let pushed = channel.push("collection", "bucket", "user:1", "my best recipe")?;
dbg!(pushed);
Ok(())
} ```