Skip to main content

seedlink_rs_client/
lib.rs

1//! Async SeedLink client for real-time seismic data streaming.
2//!
3//! Connect to SeedLink v3/v4 servers (IRIS, BMKG, GEOFON, etc.) and receive
4//! miniSEED records in real-time over TCP.
5//!
6//! # Example
7//!
8//! ```no_run
9//! # async fn example() -> seedlink_rs_client::Result<()> {
10//! use seedlink_rs_client::SeedLinkClient;
11//!
12//! let mut client = SeedLinkClient::connect("rtserve.iris.washington.edu:18000").await?;
13//! client.station("ANMO", "IU").await?;
14//! client.select("BHZ").await?;
15//! client.data().await?;
16//! client.end_stream().await?;
17//!
18//! while let Some(frame) = client.next_frame().await? {
19//!     println!("seq={}, payload={} bytes", frame.sequence(), frame.payload().len());
20//! }
21//! # Ok(())
22//! # }
23//! ```
24
25pub(crate) mod client;
26pub(crate) mod connection;
27pub(crate) mod error;
28#[cfg(test)]
29pub(crate) mod mock;
30pub(crate) mod negotiate;
31pub(crate) mod reconnect;
32pub(crate) mod state;
33pub(crate) mod stream;
34
35pub use client::SeedLinkClient;
36pub use error::{ClientError, Result};
37pub use futures_core::Stream;
38pub use reconnect::{ReconnectConfig, ReconnectingClient};
39pub use seedlink_rs_protocol::DataFrame;
40pub use state::{ClientConfig, ClientState, OwnedFrame, ServerInfo, StationKey};
41pub use stream::frame_stream;