-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse and emit attributes connected to the request/response defs in r…
…uma_api macro
- Loading branch information
Showing
6 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use ruma_api::ruma_api; | ||
|
||
ruma_api! { | ||
metadata: { | ||
description: "Does something.", | ||
method: POST, // An `http::Method` constant. No imports required. | ||
name: "some_endpoint", | ||
path: "/_matrix/some/endpoint/:baz", | ||
rate_limited: false, | ||
requires_authentication: false, | ||
} | ||
|
||
#[not_a_real_attribute_should_fail] | ||
request: { | ||
pub foo: String, | ||
#[ruma_api(header = CONTENT_TYPE)] | ||
pub content_type: String, | ||
#[ruma_api(query)] | ||
pub bar: String, | ||
#[ruma_api(path)] | ||
pub baz: String, | ||
} | ||
|
||
response: { | ||
pub value: String, | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: cannot find attribute `not_a_real_attribute_should_fail` in this scope | ||
--> $DIR/04-attributes.rs:13:7 | ||
| | ||
13 | #[not_a_real_attribute_should_fail] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |