1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! Rust SDK for the MarpleDB API.
//!
//! The SDK provides async helpers for checking API health, managing streams,
//! listing datasets, uploading files, waiting for imports, and fetching
//! pre-signed download links.
//!
//! # Quickstart
//!
//! ```no_run
//! use marple_db::{ImportStatus, MarpleDB, PushFileOptions};
//! use serde_json::json;
//! use std::time::Duration;
//!
//! # async fn run() -> marple_db::Result<()> {
//! let db = MarpleDB::new(
//! "https://db.marpledata.com/api/v1",
//! "mdb_your_token_here",
//! )?;
//! let stream = db.get_stream("runs").await?;
//! let dataset = db
//! .push_file(
//! stream.id,
//! "run.csv",
//! PushFileOptions::builder()
//! .metadata([("source", json!("example"))])
//! .build(),
//! )
//! .await?;
//! let dataset = db
//! .wait_for_import(stream.id, dataset.id, Duration::from_secs(180))
//! .await?;
//! assert_eq!(dataset.import_status, ImportStatus::Finished);
//! # Ok(())
//! # }
//! ```
//!
//! # Core Types
//!
//! - [`MarpleDB`] is the API client.
//! - [`PushFileOptions`] configures uploads.
//! - [`ImportStatus`] describes dataset import state.
//! - [`Error`] is the structured SDK error type.
//! - [`ProgressReporter`] receives transfer progress updates.
//!
//! # Errors
//!
//! ```no_run
//! # async fn run(db: marple_db::MarpleDB) -> marple_db::Result<()> {
//! match db.get_stream("runs").await {
//! Ok(stream) => println!("stream id: {}", stream.id),
//! Err(marple_db::Error::StreamNotFound { name }) => {
//! eprintln!("missing stream: {name}");
//! }
//! Err(error) => return Err(error),
//! }
//! # Ok(())
//! # }
//! ```
//!
//! This crate is async and does not install a runtime. The examples use Tokio,
//! but callers can use any runtime supported by `reqwest`.
pub use ;
pub use ;
pub use ;
pub use ;