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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//! Unofficial, ergonomic Rust client for the Ably Chat REST API (v4).
//!
//! Not affiliated with or endorsed by Ably.
//!
//! # Overview
//!
//! Build a [`Client`] with an [`Auth`] credential, scope it to a room with
//! [`Client::room`], then chain into [`Messages`], [`Reactions`], or
//! [`OccupancyHandle`]. Each operation is a builder that terminates in a bare
//! `.await` (via [`IntoFuture`]); every fallible call
//! returns [`Result<T>`]. Handles are cheap to [`Clone`] (`Arc`-backed) and
//! `Send + Sync`.
//!
//! History and versions are paginated: `.await` a query for the first
//! [`Page`], or call `.into_stream()` to follow the `next` links to exhaustion.
//!
//! # Example
//!
//! ```no_run
//! use ably_chat::prelude::*;
//! use futures::StreamExt;
//!
//! # async fn run() -> ably_chat::Result<()> {
//! // Build a client and scope it to a room (rooms are implicit — this creates
//! // nothing server-side).
//! let client = Client::builder(Auth::api_key("appId.keyId:keySecret")).build();
//! let room = client.room("my-room");
//!
//! // Send a message.
//! let sent = room.messages().send("hello, world").await?;
//! println!("sent message {}", sent.serial);
//!
//! // Stream history (newest first by default), following pagination. The
//! // stream is `!Unpin`, so pin it before polling with `.next()`.
//! let mut history = std::pin::pin!(room.messages().history().into_stream());
//! while let Some(message) = history.next().await {
//! let message = message?;
//! println!("{}: {}", message.client_id, message.text);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # Permissions & token issuance
//!
//! Build the capability string for a TokenRequest or JWT with `Capability`
//! (feature `capabilities`), mint the JWT itself with `mint_ably_jwt`
//! (feature `jwt`; **server-side only** — it signs with your API secret),
//! and let the client refresh Bearer credentials automatically by building
//! [`Auth`] with [`Auth::provider`] instead of a static token (ADR-0012,
//! SPEC §13).
//!
//! Prefer not to sign requests yourself? `KeyTokenProvider` (feature
//! `token-issuance`, off by default) mints Ably Tokens through the platform
//! `requestToken` endpoint instead — also **server-side only**. Pair it with
//! [`Auth::provider`] the same way (ADR-0012 item 5, SPEC §13).
/// Low-level generated bindings. Escape hatch; NOT covered by the pre-1.0
/// stability guarantee and may change on regeneration.
// Ergonomic layer (filled in by later phases).
pub use ;
pub use *;
pub use *;
pub use ;
pub use ;
pub use KeyTokenProvider;
pub use ;
pub use Room;
pub use ;
pub use ;
pub use ;
pub use Page;