62 Commits

Author SHA1 Message Date
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
d36f82faeb
api: Use thiserror to derive many Display + Error implementations 2020-09-22 01:48:45 +02:00
Jonas Platte
bf27285766
api: Import-rename std::error::Error 2020-09-22 01:43:16 +02:00
Vincent Lee
d36d005b97
Change requires_authentication: bool to authentication: AuthScheme 2020-09-18 16:28:51 +02:00
Jonas Platte
01c7eef72f
Consistently put an empty line after inner module docs 2020-08-24 21:42:48 +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
Jonas Platte
c1b4b77bbd
api: Update change log 2020-08-12 23:43:57 +02:00
Jonas Platte
987d48666c
Split Endpoint trait into OutgoingRequest, IncomingRequest 2020-08-12 23:33:27 +02:00
Jonas Platte
abc34eeb7e
Move manual endpoint impl test into its own file 2020-08-12 23:33:27 +02:00
Jonas Platte
52f7546c47
Make most things in ruma_api::error actually public (no more #[doc(hidden)])
So people can implement their own endpoints without the macros and
without using undocumented parts of the API
2020-08-12 23:33:27 +02:00
Jonas Platte
835c721a12
Fix non-empty Void 2020-08-12 14:21:50 +02:00
Devin Ragotzy
906465d0c3
Replace all ::ruma_api:: with the discovered crate name or $crate 2020-08-12 14:01:43 +02:00
florianjacob
467e7afd5e
Require std::error::Error for EndpointError
and implement it for ruma_api::error::FromHttpResponseError and Void.
This allows integrating EndpointErrors in the common rust error
ecosystem like thiserror and anyhow.
2020-08-12 14:00:44 +02:00
Jonas Platte
9cf552f361
Add Endpoint::{IncomingRequest, IncomingResponse}
With these, it is no longer necessary to copy over the Endpoint trait's
where clauses whenever it is used as a bound
2020-08-09 03:18: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
a0a1987bbf
Small style fix 2020-08-09 00:01:50 +02:00
Jonas Platte
1fbf05d71f
Fix some bad formatting 2020-08-08 21:52:58 +02:00
Jonas Platte
0366466792
Use toplevel imports in ruma_api! expansion 2020-08-08 21:23:07 +02:00
Jonas Platte
d6d84a9a70
Bump ruma-identifiers version 2020-08-08 18:28:23 +02:00
Jonas Platte
a1916837f9
Bump ruma-identifiers version 2020-08-08 16:21:11 +02:00
Jonas Platte
c2cf8682e6
Don't use * imports in ruma_api_lifetime test 2020-08-08 13:23:57 +02:00
Jonas Platte
30e73186e7
Bump dependencies 2020-08-07 19:13:00 +02:00
Devin Ragotzy
7e3ebff089 Add tests testing failing Outgoing derive for query fields 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
588a6035f0 Use Outgoing trait in ruma_api_lifetime tests 2020-08-07 00:48:01 +02:00
Devin Ragotzy
2beaf450a3 Add a query_map field to ruma_api! lifetime test 2020-08-07 00:48:01 +02:00
Devin Ragotzy
c980644d77 Clean up and fix missing comma for request query map 2020-08-07 00:48:01 +02:00
Devin Ragotzy
f0a5a43455 Move lifetime tests into their own file 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
c2342e3ef7 Add failing test to ruma-api for lifetimes in ruma_api! macro 2020-08-07 00:48:01 +02:00
Jonas Platte
9bc6ce9201
Use identifier macros for tests 2020-08-05 00:12:44 +02:00
Devin Ragotzy
2fbdd674ab Refactor impl_outgoing_with_incoming_self and add struct variant 2020-08-01 18:19:17 +02:00
Devin Ragotzy
f0fb9a69c0 Handle enums and nested types properly 2020-08-01 18:19:17 +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
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
Jonas Platte
dbdbc148ea
Release ruma-api 0.17.0-alpha.1 2020-07-29 17:25:32 +02:00
Jonas Platte
fa8c7b020b
Release ruma-events 0.22.0-alpha.1 2020-07-29 17:09:29 +02:00
Jonas Platte
48777f2eed
Release ruma-serde 0.2.3 2020-07-29 16:48:02 +02:00
Devin Ragotzy
71e537d123 Move move-value test decl into logical mods for each 2020-07-29 08:50:08 -04:00
Devin Ragotzy
47b6adb524 Add tests for ruma_api! macro ensuring request/response generation ok 2020-07-28 18:55:02 -04:00
Devin Ragotzy
f00bad3895 Add try_build test testing new type body fields are declared last 2020-07-28 17:13:33 -04:00
Devin Ragotzy
b68b63ab8d Remove runtime panic caused by header <-> string conversion 2020-07-28 17:13:33 -04:00
Jonas Platte
c363494905
Release ruma-identifiers 0.17.1 2020-07-26 15:04:20 +02:00
Jonas Platte
360628067b
Release ruma-common 0.2.0 2020-07-24 21:08:46 +02:00
Jonas Platte
080a537664
Release ruma-identifiers 0.17.0 2020-07-22 23:06:44 +02:00
Jonas Platte
4238c91e24
Update MSRV policy 2020-07-22 23:05:50 +02:00
skim
b260a13d4b
move and rename ruma_events::json::EventJson to ruma_common::raw::Raw 2020-07-16 07:31:36 -07:00
Jonas Platte
1a1884ce81
identifiers: Bump version (prerelease), update change log 2020-07-15 00:45:47 +02:00