26 Commits

Author SHA1 Message Date
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
7cb7e6a211
api-macros: Move most parts of api and util into more specific modules 2021-04-05 14:05:43 +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
c27b17e5f9
Upgrade proc-macro-crate to 1.0.0 2021-03-23 20:43:58 +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
Jonas Platte
5562a23aaa
Move Raw, Outgoing and all macro code from ruma-common to ruma-serde 2020-11-28 03:45:39 +01:00
Jonas Platte
5175d3d622
api_macros: Improve readability, fix lines >100 chars 2020-11-27 23:06:31 +01:00
Jonas Platte
fdd326edf7
Move Outgoing from ruma-api to ruma-common
The derive macro moves from ruma-api-macros to a new ruma-common-macros
crate likewise.
2020-09-22 21:35:10 +02:00
Devin Ragotzy
906465d0c3
Replace all ::ruma_api:: with the discovered crate name or $crate 2020-08-12 14:01:43 +02:00
Devin Ragotzy
f455d4c8ab
Remove Response lifetime generation code in ruma_api macro
… and enforce that there are no lifetimes in response {}
2020-08-09 03:01:19 +02:00
Jonas Platte
1fbf05d71f
Fix some bad formatting 2020-08-08 21:52:58 +02:00
Devin Ragotzy
1060d63057 Use full type with Outgoing trait for request query deserialization 2020-08-07 00:48:01 +02:00
Devin Ragotzy
e783288ef0 Limit when RequestQuery impls Deserialize and impl Outgoing 2020-08-07 00:48:01 +02:00
Devin Ragotzy
5103baeb4b Add semicolons and the other possible syn::Type types 2020-08-07 00:48:01 +02:00
Devin Ragotzy
1336cd8c41 Handle tuple types in collect_lifetime_idents 2020-08-07 00:48:01 +02:00
Devin Ragotzy
4e2f1a19e1 Fix typo and rename copy_lifetime_ident -> collect_lifetime_ident 2020-08-07 00:48:01 +02:00
Devin Ragotzy
80237d6dd1 Fix clippy warnings 2020-08-07 00:48:01 +02:00
Devin Ragotzy
0793724264 Refactor to use Req/ResLifetimes struct for adding lifetimes to req/res 2020-08-07 00:48:01 +02:00
Devin Ragotzy
1155edcaed Add lifetime discovery and collection functions to ruma-api-macro 2020-08-07 00:48:01 +02:00
Jonas Platte
f5c529bc36
Try not to rely on prelude in ruma-api-macros generated code
… and fix some lines that were too wide
2020-08-01 01:21:09 +02:00
Jonas Platte
12c7a4a17c
Rewrap comment 2020-08-01 01:02:45 +02:00
Jonas Platte
10184cb9ca
Use a dedicated method for conversion from Ruma request type to http::Request 2020-08-01 01:01:15 +02:00
Ragotzy.devin
4ff6c6ecbe
Refactor Request/Response's TryFrom impl by generating match stmt
... by moving repetitive parts into a macro_rules macro
2020-07-08 01:44:25 +02:00
Ragotzy.devin
214c1b681f
Add guard in ruma_api! macro for invalid characters in path
Returns a compiler error if any non ASCII characters are found. Add
trybuild test for invalid path characters.
2020-07-02 16:27:49 +02:00
Ragotzy.devin
b08b1d1819
Refactor large blocks of Api::to_tokens into separate functions 2020-07-01 23:35:18 +02:00