1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use js_int::UInt;
use ruma_api::ruma_api;
use ruma_identifiers::UserId;
use serde::{Deserialize, Serialize};
ruma_api! {
metadata {
description: "Performs a search for users on the homeserver.",
method: POST,
name: "search_users",
path: "/_matrix/client/r0/user_directory/search",
rate_limited: true,
requires_authentication: true,
}
request {
pub search_term: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<UInt>,
}
response {
pub results: Vec<User>,
pub limited: bool,
}
error: crate::Error
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct User {
pub user_id: UserId,
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar_url: Option<String>,
}