Jonas Platte
536a8aea1b
api-macros: Replace ToTokens implementations with inherent methods
2021-04-05 12:57:50 +02:00
Jonas Platte
679508f831
api-macros: Move parsing logic into a separate module
2021-04-05 12:07:34 +02:00
Jonas Platte
ae6595339c
Stop stripping serde attributes
...
To still prevent 'unknown attribute' errors, the attribute is registered
using a dummy derive macro where needed.
2020-12-13 11:54:39 +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
4d9fdeb61d
api-macros: Remove RawResponse
2020-11-27 21:15:37 +01:00
Devin Ragotzy
c15382ca41
api-macros: Make Response header fields override any defaults
2020-11-01 14:04:34 +01:00
Jonas Platte
e1975c2035
Be more consistent about whitespace
2020-10-24 00:44:01 +02: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
Jonas Platte
67d113ba57
api: Add non_exhaustive attribute to request and reponse types through the macro
2020-09-11 21:01:02 +02:00
Devin Ragotzy
a8b4bad684
Support optional header values in request/response types
2020-08-21 19:53:46 +02:00
Jonas Platte
30a0a39d2b
Outgoing derive: Replace incoming_no_deserialize with incoming_derive(!Deserialize)
2020-08-17 22:08:56 +02:00
Devin Ragotzy
a6c1b8f0bd
Parse and emit attributes connected to the request/response defs in ruma_api macro
2020-08-14 00:01:19 +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
6877c2f38d
Use ruma_api crate from ruma or if renamed or not in crate prelude
2020-08-10 23:49:14 +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
4e2f1a19e1
Fix typo and rename copy_lifetime_ident -> collect_lifetime_ident
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
e7f7c3bb9d
Add lifetime params to Request/Response when needed
2020-08-07 00:48:01 +02:00
Devin Ragotzy
c86f0b106b
Re-add the Outgoing trait and derive macro
...
The Outgoing trait now has no attributes except incoming_no_deserialize,
it looks for any references and lifetimes in a struct declaration and
removes them. The point of the Outgoing trait is to allow references to
be serialized and owned values to come out of deserialization. It has no
ability to wrap values in Raw (then EventResult).
2020-07-31 12:59:19 -04:00
Devin Ragotzy
b68b63ab8d
Remove runtime panic caused by header <-> string conversion
2020-07-28 17:13:33 -04:00
Devin Ragotzy
4c01fee5c5
Move new type body init field (last field initialized)
2020-07-28 17:13:26 -04:00
Jonas Platte
05a99a00a0
Only use matches crate as a dev-dependency
2020-07-22 23:06:35 +02:00
Devin R
605680530b
Add ability to feature gate fields in ruma_api! macro
2020-07-15 19:14:04 -04:00
Jonas Platte
ded60cc935
Use matches! instead of manual match
-> bool
2020-07-15 12:21:32 +02:00
Ragotzy.devin
b08b1d1819
Refactor large blocks of Api::to_tokens into separate functions
2020-07-01 23:35:18 +02:00
Jonas Platte
f8b1aef906
Integrate ruma-api
2020-06-05 01:59:26 +02:00