17 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
Johannes Becker
0ca5785ead api: Replace access_token Option with SendAccessToken enum 2021-04-23 10:56:04 +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
6585aeb628
api: Make OutgoingResponse a supertrait of EndpointError 2021-04-13 13:15:57 +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
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
Jonas Platte
c523fa0f74
Use ruma_api::try_deserialize in manual endpoint implementations 2021-04-05 22:33:05 +02:00
Jonas Platte
95d21552e0
Use a dedicated method for conversion from http::Request to Ruma request types 2020-12-13 12:59:21 +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
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
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