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
//! Official Rust SDK for the [Rerout](https://rerout.co) branded-link API.
//!
//! Rerout is branded link infrastructure on Cloudflare. This crate wraps the
//! HTTP API: create short links, render QR codes, read analytics, and verify
//! webhook signatures.
//!
//! Every public method is async and requires a [Tokio](https://tokio.rs)
//! runtime. The client is built through a builder and is cheap to clone — the
//! inner [`reqwest::Client`] shares a connection pool.
//!
//! # Quick start
//!
//! ```no_run
//! use rerout::{CreateLinkInput, Rerout};
//!
//! # async fn run() -> Result<(), rerout::ReroutError> {
//! let rerout = Rerout::new("rrk_live_xxx")?;
//!
//! let link = rerout
//! .links()
//! .create(&CreateLinkInput::new("https://example.com/q4-sale"))
//! .await?;
//!
//! println!("Short URL: {}", link.short_url);
//! # Ok(())
//! # }
//! ```
//!
//! # Namespaces
//!
//! The [`Rerout`] client exposes three namespaces:
//!
//! - [`Rerout::links`] — create, list, get, update, delete, and per-link stats.
//! - [`Rerout::project`] — aggregate project stats and project metadata.
//! - [`Rerout::qr`] — a pure QR URL builder plus an authenticated SVG fetch.
//!
//! # Error handling
//!
//! Every fallible call returns [`Result<T, ReroutError>`](Result). Match on the
//! [`ReroutError`] variant for branching, or read [`ReroutError::code`] for the
//! stable string identifier the API attaches to a failure.
//!
//! # Webhook signatures
//!
//! Incoming webhook deliveries are signed. Verify them with
//! [`webhooks::verify_rerout_signature`], which performs a constant-time HMAC
//! comparison and rejects stale timestamps.
pub use ;
pub use ;
pub use Links;
pub use ;
pub use Project;
pub use ;
pub use ;