api: Add _path suffix to new path metadata keywords
This commit is contained in:
parent
bbda001072
commit
4ccf79cb67
@ -15,9 +15,9 @@ mod kw {
|
|||||||
syn::custom_keyword!(method);
|
syn::custom_keyword!(method);
|
||||||
syn::custom_keyword!(name);
|
syn::custom_keyword!(name);
|
||||||
syn::custom_keyword!(path);
|
syn::custom_keyword!(path);
|
||||||
syn::custom_keyword!(unstable);
|
syn::custom_keyword!(unstable_path);
|
||||||
syn::custom_keyword!(r0);
|
syn::custom_keyword!(r0_path);
|
||||||
syn::custom_keyword!(stable);
|
syn::custom_keyword!(stable_path);
|
||||||
syn::custom_keyword!(rate_limited);
|
syn::custom_keyword!(rate_limited);
|
||||||
syn::custom_keyword!(authentication);
|
syn::custom_keyword!(authentication);
|
||||||
syn::custom_keyword!(added);
|
syn::custom_keyword!(added);
|
||||||
@ -117,9 +117,9 @@ impl Parse for Metadata {
|
|||||||
FieldValue::Method(m) => set_field(&mut method, m)?,
|
FieldValue::Method(m) => set_field(&mut method, m)?,
|
||||||
FieldValue::Name(n) => set_field(&mut name, n)?,
|
FieldValue::Name(n) => set_field(&mut name, n)?,
|
||||||
FieldValue::Path(p) => set_field(&mut path, p)?,
|
FieldValue::Path(p) => set_field(&mut path, p)?,
|
||||||
FieldValue::Unstable(p) => set_field(&mut unstable_path, p)?,
|
FieldValue::UnstablePath(p) => set_field(&mut unstable_path, p)?,
|
||||||
FieldValue::R0(p) => set_field(&mut r0_path, p)?,
|
FieldValue::R0Path(p) => set_field(&mut r0_path, p)?,
|
||||||
FieldValue::Stable(p) => set_field(&mut stable_path, p)?,
|
FieldValue::StablePath(p) => set_field(&mut stable_path, p)?,
|
||||||
FieldValue::RateLimited(value, attrs) => {
|
FieldValue::RateLimited(value, attrs) => {
|
||||||
rate_limited.push(MetadataField { attrs, value });
|
rate_limited.push(MetadataField { attrs, value });
|
||||||
}
|
}
|
||||||
@ -205,9 +205,9 @@ enum Field {
|
|||||||
Method,
|
Method,
|
||||||
Name,
|
Name,
|
||||||
Path,
|
Path,
|
||||||
Unstable,
|
UnstablePath,
|
||||||
R0,
|
R0Path,
|
||||||
Stable,
|
StablePath,
|
||||||
RateLimited,
|
RateLimited,
|
||||||
Authentication,
|
Authentication,
|
||||||
Added,
|
Added,
|
||||||
@ -231,15 +231,15 @@ impl Parse for Field {
|
|||||||
} else if lookahead.peek(kw::path) {
|
} else if lookahead.peek(kw::path) {
|
||||||
let _: kw::path = input.parse()?;
|
let _: kw::path = input.parse()?;
|
||||||
Ok(Self::Path)
|
Ok(Self::Path)
|
||||||
} else if lookahead.peek(kw::unstable) {
|
} else if lookahead.peek(kw::unstable_path) {
|
||||||
let _: kw::unstable = input.parse()?;
|
let _: kw::unstable_path = input.parse()?;
|
||||||
Ok(Self::Unstable)
|
Ok(Self::UnstablePath)
|
||||||
} else if lookahead.peek(kw::r0) {
|
} else if lookahead.peek(kw::r0_path) {
|
||||||
let _: kw::r0 = input.parse()?;
|
let _: kw::r0_path = input.parse()?;
|
||||||
Ok(Self::R0)
|
Ok(Self::R0Path)
|
||||||
} else if lookahead.peek(kw::stable) {
|
} else if lookahead.peek(kw::stable_path) {
|
||||||
let _: kw::stable = input.parse()?;
|
let _: kw::stable_path = input.parse()?;
|
||||||
Ok(Self::Stable)
|
Ok(Self::StablePath)
|
||||||
} else if lookahead.peek(kw::rate_limited) {
|
} else if lookahead.peek(kw::rate_limited) {
|
||||||
let _: kw::rate_limited = input.parse()?;
|
let _: kw::rate_limited = input.parse()?;
|
||||||
Ok(Self::RateLimited)
|
Ok(Self::RateLimited)
|
||||||
@ -266,9 +266,9 @@ enum FieldValue {
|
|||||||
Method(Ident),
|
Method(Ident),
|
||||||
Name(LitStr),
|
Name(LitStr),
|
||||||
Path(EndpointPath),
|
Path(EndpointPath),
|
||||||
Unstable(EndpointPath),
|
UnstablePath(EndpointPath),
|
||||||
R0(EndpointPath),
|
R0Path(EndpointPath),
|
||||||
Stable(EndpointPath),
|
StablePath(EndpointPath),
|
||||||
RateLimited(LitBool, Vec<Attribute>),
|
RateLimited(LitBool, Vec<Attribute>),
|
||||||
Authentication(AuthScheme, Vec<Attribute>),
|
Authentication(AuthScheme, Vec<Attribute>),
|
||||||
Added(MatrixVersionLiteral),
|
Added(MatrixVersionLiteral),
|
||||||
@ -295,9 +295,9 @@ impl Parse for FieldValue {
|
|||||||
Field::Method => Self::Method(input.parse()?),
|
Field::Method => Self::Method(input.parse()?),
|
||||||
Field::Name => Self::Name(input.parse()?),
|
Field::Name => Self::Name(input.parse()?),
|
||||||
Field::Path => Self::Path(input.parse()?),
|
Field::Path => Self::Path(input.parse()?),
|
||||||
Field::Unstable => Self::Unstable(input.parse()?),
|
Field::UnstablePath => Self::UnstablePath(input.parse()?),
|
||||||
Field::R0 => Self::R0(input.parse()?),
|
Field::R0Path => Self::R0Path(input.parse()?),
|
||||||
Field::Stable => Self::Stable(input.parse()?),
|
Field::StablePath => Self::StablePath(input.parse()?),
|
||||||
Field::RateLimited => Self::RateLimited(input.parse()?, attrs),
|
Field::RateLimited => Self::RateLimited(input.parse()?, attrs),
|
||||||
Field::Authentication => Self::Authentication(input.parse()?, attrs),
|
Field::Authentication => Self::Authentication(input.parse()?, attrs),
|
||||||
Field::Added => Self::Added(input.parse()?),
|
Field::Added => Self::Added(input.parse()?),
|
||||||
|
@ -8,9 +8,9 @@ ruma_api! {
|
|||||||
method: POST, // An `http::Method` constant. No imports required.
|
method: POST, // An `http::Method` constant. No imports required.
|
||||||
name: "some_endpoint",
|
name: "some_endpoint",
|
||||||
path: "/_matrix/some/endpoint/:baz",
|
path: "/_matrix/some/endpoint/:baz",
|
||||||
unstable: "/_matrix/some/msc1234/endpoint/:baz",
|
unstable_path: "/_matrix/some/msc1234/endpoint/:baz",
|
||||||
r0: "/_matrix/some/r0/endpoint/:baz",
|
r0_path: "/_matrix/some/r0/endpoint/:baz",
|
||||||
stable: "/_matrix/some/v1/endpoint/:baz",
|
stable_path: "/_matrix/some/v1/endpoint/:baz",
|
||||||
rate_limited: false,
|
rate_limited: false,
|
||||||
authentication: None,
|
authentication: None,
|
||||||
added: 1.0,
|
added: 1.0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user