Skip to main content

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 hyperstack_stacks::ore::OreStack;
6//!
7//! #[tokio::main]
8//! async fn main() -> anyhow::Result<()> {
9//!     let hs = HyperStack::<OreStack>::connect().await?;
10//!     
11//!     for round in hs.views.latest().listen() {
12//!         println!("Round: {:?}", round);
13//!     }
14//!     
15//!     Ok(())
16//! }
17//! ```
18
19mod auth;
20mod client;
21mod config;
22mod connection;
23mod entity;
24mod error;
25mod frame;
26pub mod prelude;
27pub mod serde_utils;
28mod store;
29mod stream;
30mod subscription;
31pub mod view;
32
33pub use auth::{AuthConfig, AuthToken, TokenTransport};
34pub use client::{HyperStack, HyperStackBuilder};
35pub use connection::ConnectionState;
36pub use entity::Stack;
37pub use error::{AuthErrorCode, HyperStackError, SocketIssue};
38pub use frame::{
39    parse_frame, parse_snapshot_entities, try_parse_subscribed_frame, Frame, Mode, Operation,
40    SnapshotEntity,
41};
42pub use store::{deep_merge_with_append, SharedStore, StoreUpdate};
43pub use stream::{
44    EntityStream, FilterMapStream, FilteredStream, KeyFilter, MapStream, RichEntityStream,
45    RichUpdate, Update, UseStream,
46};
47
48pub use subscription::{ClientMessage, Subscription};
49pub use view::{
50    RichWatchBuilder, StateView, UseBuilder, ViewBuilder, ViewHandle, Views, WatchBuilder,
51};