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
//! 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(())
//! # }
//! ```
/// 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 Room;
pub use ;
pub use ;
pub use ;
pub use Page;