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
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
Jonas Platte
1fbf05d71f
Fix some bad formatting
2020-08-08 21:52:58 +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
Devin Ragotzy
b68b63ab8d
Remove runtime panic caused by header <-> string conversion
2020-07-28 17:13:33 -04: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
5376a3fc6e
Add colons to ruma_api! macro after each keyword
2020-06-30 13:06:37 +02:00
Jonas Platte
51d7875b2f
Add 'ruma-api/' from commit '2151711f64e99a5da370d48fa92795f2d4799866'
...
git-subtree-dir: ruma-api
git-subtree-mainline: bb037a5c42c51567a3b9e41c2c131cef9867a4aa
git-subtree-split: 2151711f64e99a5da370d48fa92795f2d4799866
2020-06-05 01:56:19 +02:00