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;
38pub mod view;
39
40pub use client::{HyperStack, HyperStackBuilder};
41pub use config::HyperStackConfig;
42pub use connection::ConnectionState;
43pub use entity::{Entity, EntityData, Filterable};
44pub use error::HyperStackError;
45pub use frame::{Frame, Mode, Operation};
46pub use store::{SharedStore, StoreUpdate};
47pub use stream::{
48    EntityStream, FilterMapStream, FilteredStream, KeyFilter, MapStream, RichEntityStream,
49    RichUpdate, Update,
50};
51pub use subscription::Subscription;
52pub use view::{StateView, ViewBuilder, ViewHandle, Views};
53
54pub use serde_json::Value;