132 Commits

Author SHA1 Message Date
Jonas Platte
f818b53ca1
Make conversions from Ruma types to http types generic
So users can select the Body type that makes the most sense for them.
2021-04-23 13:26:10 +02:00
Jonas Platte
ae26be88c5
api-macros: Refactor access token sending logic 2021-04-23 13:22:20 +02:00
Johannes Becker
0ca5785ead api: Replace access_token Option with SendAccessToken enum 2021-04-23 10:56:04 +02:00
Jonas Platte
c816630058
client-api: Allow testing sync_events structs for exhaustiveness
… even without `unstable-exhaustive-types`.
2021-04-19 01:37:32 +02:00
Jonas Platte
de949815af
Release ruma-api 0.17.0-alpha.4 2021-04-17 19:39:02 +02:00
Jonas Platte
c1693569f1
api: Replace bytes::Buf by AsRef<u8> for reading
This allows us to switch back to serde_json::from_slice instead of
serde_json::from_reader, because the latter is significantly slower.

See https://github.com/serde-rs/json/issues/160
2021-04-13 22:12:16 +02:00
Jonas Platte
e4ae2a40ee
Qualify more paths in macro-generated code 2021-04-13 21:50:01 +02:00
Jonas Platte
96aa55e3b9
api-macros: Silence warning about unknown clippy lint for older clippy versions 2021-04-13 15:08:33 +02:00
Jonas Platte
6585aeb628
api: Make OutgoingResponse a supertrait of EndpointError 2021-04-13 13:15:57 +02:00
Devin Ragotzy
f2286f8ae5 Fix confusing variable naming in ruma-api-macros 2021-04-13 01:17:46 +02:00
Jonas Platte
15d92728ca
api-macros: Silence clippy::inconsistent_struct_constructor in generated code 2021-04-12 20:38:23 +02:00
Jonas Platte
15433a9751
api-macros: Fix a typo 2021-04-12 20:38:23 +02:00
Jonas Platte
e7a31f1fd1
api-macros: Split response code generation into more files 2021-04-12 20:38:23 +02:00
Jonas Platte
59d47227a6
api-macros: Split request code generation into more files 2021-04-12 20:38:23 +02:00
Jonas Platte
0e197aae0b
api: Update try_from_http_request to be generic like try_from_http_response 2021-04-12 20:38:22 +02:00
Jonas Platte
23ba0bc164
api-macros: Refactor request code generation 2021-04-12 20:38:22 +02:00
Jonas Platte
a20f03894e
api-macros: Inline request codegen methods 2021-04-12 20:38:22 +02:00
Jonas Platte
2e2609b752
api-macros: Fix a typo 2021-04-12 20:38:22 +02:00
Jonas Platte
b122dcc135
api: Introduce OutgoingResponse trait 2021-04-12 20:38:22 +02:00
Jonas Platte
6f5c1ee953
api: Stop storing the http::Request in RequestDeserializationError 2021-04-12 20:38:22 +02:00
Jonas Platte
2ac020173b
api: Introduce IncomingResponse trait 2021-04-12 20:38:22 +02:00
Jonas Platte
effb53444d
api: Stop storing the http::Response in ResponseDeserializationError 2021-04-12 20:38:22 +02:00
Kévin Commaille
b89a18fa16
client-api: Fix check warnings and tests with no feature enabled 2021-04-12 18:57:04 +02:00
Jonas Platte
a68b854734
api: Refactor macro code and improve error handling
* Inline lots of methods that were only used once
* Create a separate error case for missing headers
2021-04-10 14:50:01 +02:00
Jonas Platte
20124cb215
api-macros: Small formatting fixes 2021-04-09 19:34:03 +02:00
Abhik Jain
455eb31c74
api-macros: Turn request codegen helper functions into methods 2021-04-09 19:28:33 +02:00
Akshay
06a2a27a99
api: Check http method in try_from_http_request 2021-04-09 17:21:05 +02:00
Kévin Commaille
963400979b
docs: Harmonize ruma modules descriptions 2021-04-07 12:14:49 +02:00
Jonas Platte
afec9f0fbf
api-macros: Generate cleaner code 2021-04-05 22:16:46 +02:00
Jonas Platte
345d0cf990
api-macros: Allow ruma_api! invocation without request / response 2021-04-05 14:49:40 +02:00
Jonas Platte
95fef0b0ec
api-macros: Make helper functions private 2021-04-05 14:13:49 +02:00
Jonas Platte
7cb7e6a211
api-macros: Move most parts of api and util into more specific modules 2021-04-05 14:05:43 +02:00
Jonas Platte
1878e8aae0
Replace some turbofishes with type annotations 2021-04-05 13:13:28 +02:00
Jonas Platte
536a8aea1b
api-macros: Replace ToTokens implementations with inherent methods 2021-04-05 12:57:50 +02:00
Jonas Platte
2e0f787ccd
api-macros: Refactor parsing logic 2021-04-05 12:39:22 +02:00
Jonas Platte
e8e0ceb17d
api-macros: Move some helper functions from util to api::parse 2021-04-05 12:18:54 +02:00
Jonas Platte
1dd6a3870a
Use mem::take instead of mem::replace where applicable 2021-04-05 12:08:29 +02:00
Jonas Platte
679508f831
api-macros: Move parsing logic into a separate module 2021-04-05 12:07:34 +02:00
Jonas Platte
1bf4157a89
Add favicon and logo URLs for rustdoc 2021-04-05 11:42:07 +02:00
Jonas Platte
db18d938e0
api-macros: Refactor error type parsing 2021-04-05 11:42:07 +02:00
Jonas Platte
c27b17e5f9
Upgrade proc-macro-crate to 1.0.0 2021-03-23 20:43:58 +01:00
Jonas Platte
a0e8bb416b
Increase MSRV from 1.43 to 1.45 2021-03-21 20:32:46 +01:00
Jonas Platte
ad608c0013
Replace syn::Error::to_compile_error with into_compile_error 2021-03-09 19:12:21 +01:00
Akshay
4d51e98707
Introduce client and server feature flags for *-api crates 2021-03-05 16:00:35 +01:00
Jonas Platte
4ced423612
Fix new clippy warnings 2021-03-01 18:38:41 +01:00
Jonas Platte
a20c75d536
Fix import grouping issues 2021-02-25 20:55:19 +01:00
Akshay
1c0dab5a47
api: Allow cfg attributes on rate_limited and authentication metadata fields 2021-02-05 12:47:43 +01:00
Akshay
b087cf75b7
Set the default Content-Type for requests to application/json 2021-01-22 17:39:06 +01:00
Jonas Platte
5dd3658324
Fix nightly CI 2021-01-18 16:22:43 +01:00
Jonas Platte
ca1f334ded
Remove documentation links from all Cargo.tomls
It was wrong for ruma-federation-api and useless for all others since
crates.io will link to docs.rs automatically if no link is given.
2021-01-17 17:00:09 +01:00