ruma_client_api/profile/
static_profile_field.rs1#![allow(clippy::exhaustive_structs)]
2
3use ruma_common::OwnedMxcUri;
4use serde::{de::DeserializeOwned, Serialize};
5
6pub trait StaticProfileField {
11 type Value: Sized + Serialize + DeserializeOwned;
13
14 const NAME: &str;
16}
17
18#[derive(Debug, Clone, Copy)]
20pub struct AvatarUrl;
21
22impl StaticProfileField for AvatarUrl {
23 type Value = OwnedMxcUri;
24 const NAME: &str = "avatar_url";
25}
26
27#[derive(Debug, Clone, Copy)]
29pub struct DisplayName;
30
31impl StaticProfileField for DisplayName {
32 type Value = String;
33 const NAME: &str = "displayname";
34}
35
36#[derive(Debug, Clone, Copy)]
38pub struct TimeZone;
39
40impl StaticProfileField for TimeZone {
41 type Value = String;
42 const NAME: &str = "m.tz";
43}