hyperstack_sdk/lib.rs
1//! Rust client SDK for connecting to HyperStack streaming servers.
2//!
3//! ```rust,ignore
4//! use hyperstack_sdk::prelude::*;
5//! use my_stack::{PumpfunToken, PumpfunTokenEntity};
6//!
7//! #[tokio::main]
8//! async fn main() -> anyhow::Result<()> {
9//! let hs = HyperStack::connect("wss://mainnet.hyperstack.xyz").await?;
10//!
11//! if let Some(token) = hs.get::<PumpfunTokenEntity>("mint_address").await {
12//! println!("Token: {:?}", token);
13//! }
14//!
15//! let mut stream = hs.watch::<PumpfunTokenEntity>().await;
16//! while let Some(update) = stream.next().await {
17//! match update {
18//! Update::Upsert { key, data } => println!("Updated: {}", key),
19//! Update::Delete { key } => println!("Deleted: {}", key),
20//! _ => {}
21//! }
22//! }
23//!
24//! Ok(())
25//! }
26//! ```
27
28mod client;
29mod config;
30mod connection;
31mod entity;
32mod error;
33mod frame;
34pub mod prelude;
35mod store;
36mod stream;
37mod subscription;
38
39pub use client::{HyperStack, HyperStackBuilder};
40pub use config::HyperStackConfig;
41pub use connection::ConnectionState;
42pub use entity::{Entity, EntityData, Filterable};
43pub use error::HyperStackError;
44pub use frame::{Frame, Mode, Operation};
45pub use store::{SharedStore, StoreUpdate};
46pub use stream::{
47 EntityStream, FilterMapStream, FilteredStream, KeyFilter, MapStream, RichEntityStream,
48 RichUpdate, Update,
49};
50pub use subscription::Subscription;
51
52pub use serde_json::Value;