oomclient/
lib.rs

1//! This crate provides an easy-to-use client for [oomstore](https://github.com/oom-ai/oomstore), a
2//! lightweight and fast feature store powered by go.
3//!
4//! ## Examples
5//!
6//! ```rust,no_run
7//! use oomclient::Client;
8//!
9//! #[tokio::main]
10//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
11//!     let mut client = Client::connect("http://localhost:50051").await?;
12//!
13//!     let features = vec!["account.state".into(), "txn_stats.count_7d".into()];
14//!     let response = client.online_get_raw("48", features.clone()).await?;
15//!     println!("RESPONSE={:#?}", response);
16//!
17//!     let response = client.online_get("48", features).await?;
18//!     println!("RESPONSE={:#?}", response);
19//!
20//!     Ok(())
21//! }
22//! ```
23
24mod client;
25mod error;
26mod server;
27mod util;
28
29mod oomagent {
30    tonic::include_proto!("oomagent");
31}
32
33pub use client::Client;
34pub use error::OomError;
35pub use oomagent::EntityRow;
36pub use server::ServerWrapper;
37
38/// Represents a dynamically typed value which can be either
39/// an int64, a double, a string, a bool, a unix milliseconds, or a
40/// bytes array.
41pub type Value = oomagent::value::Value;
42
43/// A result holding an Error.
44pub type Result<T> = std::result::Result<T, OomError>;