Kévin Commaille
f05d0e03a1
api: Disallow #[serde(flatten)] for single-body-fields of requests and responses
...
`#[ruma_api(body)]` must be used instead.
2024-12-15 03:07:49 -05:00
Jason Volk
8ce5d8eb87
reserve outgoing request headers
...
Signed-off-by: Jason Volk <jason@zemos.net>
2024-10-30 05:40:07 +00:00
Jason Volk
1d0b06b581
fix tests for ContentDisposition macro support
...
Signed-off-by: Jason Volk <jason@zemos.net>
2024-09-24 19:21:09 +00:00
strawberry
11155e576a
Merge remote-tracking branch 'upstream/main' into conduwuit-changes
2024-09-07 12:20:19 -04:00
Jonas Platte
4547da0b7b
Fix CI by changing where deprecations are added and allowed
2024-09-07 14:31:24 +00:00
Jonas Platte
6a049c93a1
macros: Fix METADATA references in generated tests
2024-09-07 14:31:24 +00:00
Jonas Platte
83acca397b
macros: Fix test cfg in macro output
2024-09-07 14:31:24 +00:00
strawberry
b003338b90
Merge remote-tracking branch 'upstream/main' into conduwuit-changes
2024-09-07 08:18:57 -04:00
Jonas Platte
0e8388abab
macros: Add __internal_macro_expand feature for better RA macro expansion
2024-09-07 07:57:30 +00:00
Jonas Platte
79025dfca4
macros: Improve internal assertions
2024-09-07 07:57:30 +00:00
Jonas Platte
de6b08a2b5
macros: Simplify internal derive macro input parsing
2024-09-07 07:57:30 +00:00
Jason Volk
3f06ade0fd
Revert "Revert "optimize for optional static response headers zero-copy zero-alloc""
...
This reverts commit 6bdc5ad326029e84fe05ed2591d9ba442bab8ff5.
Revert "Revert "Fix assumptions about header value types""
This reverts commit 03037f6c92ffb43388022d288e5a36f20a8559dd.
2024-08-15 05:20:21 +00:00
Jason Volk
11cbd52af1
estimate and reserve capacity in outgoing headers map
...
Signed-off-by: Jason Volk <jason@zemos.net>
2024-08-14 02:11:25 -04:00
strawberry
69b2bc4b8c
Merge remote-tracking branch 'upstream/main' into conduwuit-changes
2024-08-14 01:47:43 -04:00
strawberry
6bdc5ad326
Revert "optimize for optional static response headers zero-copy zero-alloc"
...
This reverts commit fd11fee88d937d69f557fa3d6ef09639c7b2e2f7.
2024-08-14 01:46:35 -04:00
strawberry
3174097e35
Revert "estimate and reserve capacity in outgoing headers map"
...
This reverts commit a6e340e24d570b1d924fff52c68d1dea72946b68.
2024-08-14 01:44:42 -04:00
strawberry
03037f6c92
Revert "Fix assumptions about header value types"
...
This reverts commit 767b7c72f782b04f8e7c714a152a08699ff8c1ca.
2024-08-14 01:44:16 -04:00
Jason Volk
fd11fee88d
optimize for optional static response headers zero-copy zero-alloc
...
Signed-off-by: Jason Volk <jason@zemos.net>
2024-08-12 22:59:57 +00:00
Jason Volk
a6e340e24d
estimate and reserve capacity in outgoing headers map
...
Signed-off-by: Jason Volk <jason@zemos.net>
2024-08-12 22:57:38 +00:00
Jason Volk
767b7c72f7
Fix assumptions about header value types
...
Signed-off-by: Jason Volk <jason@zemos.net>
2024-08-12 20:56:31 +00:00
Kévin Commaille
f73ba5556c
api: Allow types implementing ToString and FromStr for header values
...
Contrary to what the previous docs said, types implementing Display did not work,
only string types worked.
2024-07-14 12:28:48 +02:00
strawberry
9a5bfad849
Merge remote-tracking branch 'upstream/main' into conduwuit-changes
2024-06-30 11:54:39 -04:00
Jason Volk
cdac2a88f8
GATs are stable
...
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-25 05:44:50 +00:00
Kévin Commaille
968c52b117
api: Rename request macro attribute query_map to query_all
...
Remove its IntoIterator bound to allow to represent
the query fields as a single struct or enum.
2024-06-21 19:15:59 +02:00
Kévin Commaille
f535ce700d
macros: Remove dead code
2024-05-12 15:49:28 +02:00
Kévin Commaille
d6c4533b7d
chore: Fix new warnings
2024-05-12 15:49:28 +02:00
avdb13
8881755235
api: Add status parameter to request attribute macro
...
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2024-04-24 14:44:49 +02:00
Jonas Platte
3dac70ead9
Remove most unreachable visibility modifiers
2023-07-19 14:32:14 +02:00
Jonas Platte
53622f8ce0
macros: Upgrade syn to 2.0
2023-04-24 17:02:23 +02:00
HKalbasi
ca99c97a0c
Use #[deprecated]
instead of doc comments
2023-02-12 19:18:06 +01:00
Jonas Platte
ff8ab6b085
Replace ruma_common::serde::urlencoded with serde_html_form
2023-01-02 17:47:33 +01:00
Jonas Platte
3211fccab0
Remove borrowing in requests
2022-11-28 14:02:35 +01:00
Jonas Platte
bdb5950fe4
macros: Remove ruma_api! macro
2022-11-12 10:17:24 +01:00
Jonas Platte
2500e8f8fa
api: Make query_string parameter of make_endpoint_url non-optional
...
When Some(_), the argument would often be an empty string. By always
using the empty string to mean "no query", we avoid trailing a `?` on
URLs without having two parameter values that mean the same thing.
2022-11-11 11:27:07 +01:00
Jonas Platte
a8ba82d585
api: Make EndpointError construction infallible
...
Simplifies error matching and preserves more information for
non-spec-compliant server errors.
2022-11-10 13:10:57 +01:00
Jonas Platte
7d018897b0
macros: Move ensure_feature_presence check from ruma_api to request / response
2022-11-10 11:33:18 +01:00
Jonas Platte
2451f33a64
api: Replace ruma_api! compile-time path check with a test
2022-11-10 11:33:17 +01:00
Jonas Platte
8d0f817f48
api: Allow incoming request method of HEAD for GET endpoints
2022-11-02 23:26:57 +01:00
Jonas Platte
f613137b31
macros: Add response attribute macro
2022-11-01 09:39:11 +01:00
Jonas Platte
af97ddaa58
macros: Remove unnecessary type distinction
2022-10-31 10:00:50 +01:00
Jonas Platte
b7c47c9e70
macros: Always implement IncomingRequest trait on IncomingRequest type
...
… rather than the `Request` type, even if `IncomingRequest` is a type
alias for it.
This (only) affects where the implementation is shown in the
documentation.
2022-10-31 09:58:36 +01:00
Jonas Platte
ec67fcbd6f
api: Use VersionHistory::new from ruma_api!
...
… and remove a now-redundant check from the macro code.
2022-10-28 10:38:52 +02:00
Jonas Platte
c7e84c5249
Fix clippy lints
...
Automated using `cargo clippy --fix`.
2022-10-26 13:38:29 +02:00
Jonas Platte
f22857e682
macros: Add request attribute macro
2022-10-24 15:28:50 +02:00
Jonas Platte
c021a14b60
macros: Rename error_ty => error
2022-10-24 15:28:50 +02:00
Jonas Platte
1be2def65a
Revert "api: Remove error_ty from Request and Response derive attributes"
...
This reverts commit 1989e0350d61ca769b258ce5f2f48360dc4b3f3c.
2022-10-24 15:28:50 +02:00
Jonas Platte
876e8e38aa
macros: Simplify Response derive attribute parsing
2022-10-22 12:25:27 +02:00
Jonas Platte
dff84efb0c
api: Remove authentication from Request derive attributes
2022-10-22 12:25:27 +02:00
Jonas Platte
c9bd9bf00b
api: Remove NonAuthRequest traits
2022-10-22 12:24:22 +02:00
Jonas Platte
1989e0350d
api: Remove error_ty from Request and Response derive attributes
2022-10-22 12:24:22 +02:00