diff --git a/src/lib.rs b/src/lib.rs index 2ed8314c..b966b9ff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,5 +43,4 @@ pub mod r0 { pub mod voip; } -/// [GET /_matrix/client/versions](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-versions) -pub mod supported_versions; +pub mod unversioned; diff --git a/src/supported_versions.rs b/src/supported_versions.rs deleted file mode 100644 index bfc24b6f..00000000 --- a/src/supported_versions.rs +++ /dev/null @@ -1,29 +0,0 @@ -/// Details about this API endpoint. -#[derive(Clone, Copy, Debug)] -pub struct Endpoint; - -/// This API endpoint's response. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Response { - /// A list of Matrix client API protocol versions supported by the homeserver. - pub versions: Vec, -} - -impl ::Endpoint for Endpoint { - type BodyParams = (); - type PathParams = (); - type QueryParams = (); - type Response = Response; - - fn method() -> ::Method { - ::Method::Get - } - - fn request_path(_params: Self::PathParams) -> String { - Self::router_path() - } - - fn router_path() -> String { - "/_matrix/client/versions".to_string() - } -} diff --git a/src/unversioned.rs b/src/unversioned.rs new file mode 100644 index 00000000..a8bf5f14 --- /dev/null +++ b/src/unversioned.rs @@ -0,0 +1,34 @@ +//! Endpoints that cannot change with new versions of the Matrix specification. + +/// [GET /_matrix/client/versions](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-versions) +pub mod get_supported_versions { + /// Details about this API endpoint. + #[derive(Clone, Copy, Debug)] + pub struct Endpoint; + + /// This API endpoint's response. + #[derive(Clone, Debug, Deserialize, Serialize)] + pub struct Response { + /// A list of Matrix client API protocol versions supported by the homeserver. + pub versions: Vec, + } + + impl ::Endpoint for Endpoint { + type BodyParams = (); + type PathParams = (); + type QueryParams = (); + type Response = Response; + + fn method() -> ::Method { + ::Method::Get + } + + fn request_path(_params: Self::PathParams) -> String { + Self::router_path() + } + + fn router_path() -> String { + "/_matrix/client/versions".to_string() + } + } +}