ruma_federation_api/discovery/
discover_homeserver.rs1use ruma_common::{
8 api::{auth_scheme::NoAuthentication, request, response},
9 metadata, OwnedServerName,
10};
11
12metadata! {
13 method: GET,
14 rate_limited: false,
15 authentication: NoAuthentication,
16 path: "/.well-known/matrix/server",
17}
18
19#[request]
21#[derive(Default)]
22pub struct Request {}
23
24#[response]
26pub struct Response {
27 #[serde(rename = "m.server")]
29 pub server: OwnedServerName,
30}
31
32impl Request {
33 pub fn new() -> Self {
35 Self {}
36 }
37}
38
39impl Response {
40 pub fn new(server: OwnedServerName) -> Self {
42 Self { server }
43 }
44}