35 Commits

Author SHA1 Message Date
Jörg Sommer
7cf5ac80c8 Make ruma client thread safe
The new tokio engine requires a client that is safe to be send between
threads. It's simply done by converting Rc to Arc and RefCell to Mutex.
2019-01-22 10:36:04 +01:00
Nathan Musoke
eb92b86ce4 Store device_id in session
The device_id is needed by the client, but otherwise inaccessible (unless
provided to the server by the client).
This is analogous to how the user_id is currently stored for guests, but
will probably be more often used.  The device_id is needed to implement e2e
encryption.
2019-01-15 16:14:20 +01:00
Jonas Platte
28d7db40ed Update to Rust 2018 2019-01-08 19:55:28 +01:00
Jonas Platte
c3ccf51b02 Use nested imports 2018-12-22 12:10:47 +01:00
Jonas Platte
1ba4f66ba9 Run rustfmt 2018-12-22 12:05:25 +01:00
Jörg Sommer
a01702093e Make cargo-clippy happy 2018-08-31 17:48:09 +02:00
Jörg Sommer
04af2e41b4 Client.log_in: Add parameter device_id
This parameter was added to the request.

a7bce18b59
2018-08-31 17:47:52 +02:00
Jörg Sommer
66037a9339 Update of hyper
* hyper::UriError was moved to http::InvalidUri

* tokio_core::reactor::Handle is no longer used by the new hyper version;
  tokio_core can get dropped completely
2018-08-31 17:47:49 +02:00
Florian Jacob
bb96b002d8 [feature(conservative_impl_trait)] is stable since rust 1.26 2018-05-17 17:37:58 +02:00
Jonas Platte
4eb8e65248 Return a copy of the session object from log_in, register_* 2017-10-19 23:24:46 +02:00
Jonas Platte
02bbfd8664 Remove unused dependency 2017-10-19 23:24:46 +02:00
Jonas Platte
92728e53e8 Add Client::sync() 2017-10-19 23:24:46 +02:00
Jonas Platte
8759d5c864 Refactor Client: use one Rc instead of three 2017-10-19 23:24:46 +02:00
Jonas Platte
3dae62ec25 Remove Client lifetime from Futures by using Rc and clones 2017-10-19 23:24:46 +02:00
Jonas Platte
ceca663d69 Implement Client::register_user 2017-10-19 23:24:46 +02:00
Jonas Platte
fcd6985618 Add more detailed documentation for Client::log_in 2017-10-19 23:24:46 +02:00
Jonas Platte
e734de5d44 Implement Client::register_guest 2017-07-12 01:25:31 +10:00
Jimmy Cuadra
39bd63d576 Add Client::log_in. 2017-07-09 02:09:41 -07:00
Jimmy Cuadra
6d1c167efb Simplify Session and authenticate requests when required. 2017-07-08 23:43:15 -07:00
Jimmy Cuadra
e509f80cdf Use a reference to convert Url into Uri.
See: https://github.com/hyperium/hyper/issues/1089#issuecomment-288842526
2017-07-07 23:49:43 -07:00
Jimmy Cuadra
da5ce8ee11 Set the path and query string before making a request. 2017-07-07 23:36:05 -07:00
Jimmy Cuadra
3b059d1735 Run rustfmt. 2017-07-07 23:24:37 -07:00
Jimmy Cuadra
60e4d9a86c Add an API module to expose endpoints. 2017-07-07 23:20:42 -07:00
Jimmy Cuadra
86e837d26f Update dependencies, use published ruma crates, add new Client constructors. 2017-07-07 23:19:12 -07:00
Jimmy Cuadra
b6f0d8d8b4 Use less verbose syntax for associated types. 2017-05-12 00:27:07 -07:00
Jimmy Cuadra
fafe30fdec Revise implementation of Client::request to use the latest ruma-api/ruma-client-api. 2017-05-11 23:36:34 -07:00
Jimmy Cuadra
6de867b223 Use Cow to avoid a string allocation. 2017-01-17 19:33:19 -08:00
Jimmy Cuadra
212d3a5e7b Make all of Endpoint's associated types optional parameters when building a request. 2017-01-16 23:16:21 -08:00
Jimmy Cuadra
1492147875 Fix style issues reported by clippy and rustfmt. 2017-01-16 23:15:25 -08:00
Victor Berger
bafc48292e Add support for authenticated endpoints. 2017-01-08 15:21:33 +01:00
Jimmy Cuadra
6daa7c22f1 Implement HTTP requests generically for all Endpoints. 2017-01-07 05:31:18 -08:00
Jimmy Cuadra
43d21222dd Use Hyper's Tokio branch. 2017-01-07 00:11:19 -08:00
Jimmy Cuadra
ba1a73e363 Correct more module names that changed. 2017-01-02 02:22:33 -08:00
Jimmy Cuadra
94d1e61e35 Update get_supported_versions for new module structure in ruma-client-api. 2017-01-02 02:04:22 -08:00
Jimmy Cuadra
b1ba09a04d Start integrating with ruma-client-api. 2016-12-31 02:17:49 -08:00