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
//! A Rust client for `net_backend_server`, built on the shared types of `net_backend_protocol`.
//!
//! For Rust apps that do not use Bevy (other engines, tools, bots, command-line programs); Bevy
//! games use `bevy_net_backend`.
//!
//! - [`Client`] (async, tokio): typed calls for every route ([`Client::call`] with any
//! [`HttpCall`](protocol::HttpCall)), the session (login, register, Steam, automatic refresh
//! before expiry, one refresh at a time, rotating refresh tokens reported through
//! [`TokenUpdates`], logout), errors as the server's codes ([`Error::Api`]).
//! - [`blocking::Client`]: the same client for programs without a runtime, with [`Reply::try_take`]
//! for game loops.
//! - Feature `ws`: the WebSocket (module `ws`): typed requests, pushes, heartbeats, reconnects that obey
//! the close codes.
//! - Features `ssh` / `sftp` / `ssh-rsa`: SSH and SFTP to the server machine's OpenSSH (module `ssh`),
//! for admin tools.
//!
//! ```no_run
//! use net_backend_client::protocol::auth::{GetAccount, LoginRequest};
//! use net_backend_client::protocol::storage::{GetObject, PutObject, WriteObject};
//! use net_backend_client::Client;
//!
//! # async fn run() -> Result<(), net_backend_client::Error> {
//! let client = Client::new("https://api.example.com")?;
//! client.login(LoginRequest::new("player@example.com", "a long password")).await?;
//! let me = client.call(&GetAccount::new()).await?;
//! client.call(&WriteObject::new("saves", "slot-1", PutObject::new(serde_json::json!({"level": 3})))).await?;
//! let save = client.call(&GetObject::new("saves", "slot-1")).await?;
//! println!("{:?} is on level {}", me.display_name, save.value["level"]);
//! # Ok(())
//! # }
//! ```
//!
//! The README is the full manual.
pub use ;
pub use ;
/// The shared message types (`net_backend_protocol`), re-exported so the versions always match.
pub use net_backend_protocol as protocol;
pub use Reply;
pub use TokenUpdates;
/// The README's Rust blocks, compiled as doctests.
;