diff --git a/ruma-client-api/src/r0/alias/get_alias.rs b/ruma-client-api/src/r0/alias/get_alias.rs index f40ac7df..4681403e 100644 --- a/ruma-client-api/src/r0/alias/get_alias.rs +++ b/ruma-client-api/src/r0/alias/get_alias.rs @@ -21,10 +21,10 @@ ruma_api! { response: { /// The room ID for this room alias. - pub room_id: &'a RoomId, + pub room_id: RoomId, /// A list of servers that are aware of this room ID. - pub servers: &'a [String], + pub servers: Vec, } error: crate::Error diff --git a/ruma-client-api/src/r0/directory.rs b/ruma-client-api/src/r0/directory.rs index c778eeaf..e6ae3669 100644 --- a/ruma-client-api/src/r0/directory.rs +++ b/ruma-client-api/src/r0/directory.rs @@ -6,34 +6,33 @@ pub mod get_room_visibility; pub mod set_room_visibility; use js_int::UInt; -use ruma_api::Outgoing; use ruma_identifiers::{RoomAliasId, RoomId}; -use serde::Serialize; +use serde::{Deserialize, Serialize}; /// A chunk of a room list response, describing one room -#[derive(Clone, Debug, Outgoing, Serialize)] -pub struct PublicRoomsChunk<'a> { +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct PublicRoomsChunk { /// Aliases of the room. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub aliases: Vec<&'a RoomAliasId>, + pub aliases: Vec, /// The canonical alias of the room, if any. #[serde(skip_serializing_if = "Option::is_none")] - pub canonical_alias: Option<&'a RoomAliasId>, + pub canonical_alias: Option, /// The name of the room, if any. #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, + pub name: Option, /// The number of members joined to the room. pub num_joined_members: UInt, /// The ID of the room. - pub room_id: &'a RoomId, + pub room_id: RoomId, /// The topic of the room, if any. #[serde(skip_serializing_if = "Option::is_none")] - pub topic: Option<&'a str>, + pub topic: Option, /// Whether the room may be viewed by guest users without joining. pub world_readable: bool, @@ -45,5 +44,5 @@ pub struct PublicRoomsChunk<'a> { /// The URL for the room's avatar, if one is set. #[serde(skip_serializing_if = "Option::is_none")] - pub avatar_url: Option<&'a str>, + pub avatar_url: Option, } diff --git a/ruma-client-api/src/r0/directory/get_public_rooms.rs b/ruma-client-api/src/r0/directory/get_public_rooms.rs index 242190d7..6420792b 100644 --- a/ruma-client-api/src/r0/directory/get_public_rooms.rs +++ b/ruma-client-api/src/r0/directory/get_public_rooms.rs @@ -3,7 +3,7 @@ use js_int::UInt; use ruma_api::ruma_api; -use super::{IncomingPublicRoomsChunk, PublicRoomsChunk}; +use super::PublicRoomsChunk; ruma_api! { metadata: { @@ -36,13 +36,13 @@ ruma_api! { response: { /// A paginated chunk of public rooms. - pub chunk: Vec>, + pub chunk: Vec, /// A pagination token for the response. - pub next_batch: Option<&'a str>, + pub next_batch: Option, /// A pagination token that allows fetching previous results. - pub prev_batch: Option<&'a str>, + pub prev_batch: Option, /// An estimate on the total number of public rooms, if the server has an estimate. pub total_room_count_estimate: Option, @@ -73,8 +73,8 @@ fn construct_response_from_refs() { let res: http::Response> = Response { chunk: vec![], - next_batch: Some("next_batch_token"), - prev_batch: Some("prev_batch_token"), + next_batch: Some("next_batch_token".into()), + prev_batch: Some("prev_batch_token".into()), total_room_count_estimate: Some(js_int::uint!(10)), } .try_into() diff --git a/ruma-client-api/src/r0/directory/get_public_rooms_filtered.rs b/ruma-client-api/src/r0/directory/get_public_rooms_filtered.rs index 72c17e23..f20f3091 100644 --- a/ruma-client-api/src/r0/directory/get_public_rooms_filtered.rs +++ b/ruma-client-api/src/r0/directory/get_public_rooms_filtered.rs @@ -12,7 +12,7 @@ use serde::{ use serde_json::Value as JsonValue; -use super::{IncomingPublicRoomsChunk, PublicRoomsChunk}; +use super::PublicRoomsChunk; ruma_api! { metadata: { @@ -51,13 +51,13 @@ ruma_api! { response: { /// A paginated chunk of public rooms. - pub chunk: Vec>, + pub chunk: Vec, /// A pagination token for the response. - pub next_batch: Option<&'a str>, + pub next_batch: Option, /// A pagination token that allows fetching previous results. - pub prev_batch: Option<&'a str>, + pub prev_batch: Option, /// An estimate on the total number of public rooms, if the server has an estimate. pub total_room_count_estimate: Option, diff --git a/ruma-client-api/src/r0/keys/get_key_changes.rs b/ruma-client-api/src/r0/keys/get_key_changes.rs index d3cc718b..ab3d08e8 100644 --- a/ruma-client-api/src/r0/keys/get_key_changes.rs +++ b/ruma-client-api/src/r0/keys/get_key_changes.rs @@ -27,11 +27,11 @@ ruma_api! { response: { /// The Matrix User IDs of all users who updated their device identity keys. - pub changed: &'a [UserId], + pub changed: Vec, /// The Matrix User IDs of all users who may have left all the end-to-end /// encrypted rooms they previously shared with the user. - pub left: &'a [UserId], + pub left: Vec, } error: crate::Error diff --git a/ruma-client-api/src/r0/message/send_message_event.rs b/ruma-client-api/src/r0/message/send_message_event.rs index ae96132a..8aef8fbe 100644 --- a/ruma-client-api/src/r0/message/send_message_event.rs +++ b/ruma-client-api/src/r0/message/send_message_event.rs @@ -41,7 +41,7 @@ ruma_api! { response: { /// A unique identifier for the event. - pub event_id: &'a EventId, + pub event_id: EventId, } error: crate::Error diff --git a/ruma-client-api/src/r0/room/aliases.rs b/ruma-client-api/src/r0/room/aliases.rs index a96edc89..b338d91e 100644 --- a/ruma-client-api/src/r0/room/aliases.rs +++ b/ruma-client-api/src/r0/room/aliases.rs @@ -20,7 +20,7 @@ ruma_api! { } response: { - aliases: &'a [RoomAliasId], + aliases: Vec, } error: crate::Error diff --git a/ruma-client-api/src/r0/state/send_state_event_for_empty_key.rs b/ruma-client-api/src/r0/state/send_state_event_for_empty_key.rs index 363af922..0ab429f9 100644 --- a/ruma-client-api/src/r0/state/send_state_event_for_empty_key.rs +++ b/ruma-client-api/src/r0/state/send_state_event_for_empty_key.rs @@ -33,7 +33,7 @@ ruma_api! { response: { /// A unique identifier for the event. - pub event_id: &'a EventId, + pub event_id: EventId, } error: crate::Error diff --git a/ruma-client-api/src/r0/state/send_state_event_for_key.rs b/ruma-client-api/src/r0/state/send_state_event_for_key.rs index fcf14ce8..3bbf82d7 100644 --- a/ruma-client-api/src/r0/state/send_state_event_for_key.rs +++ b/ruma-client-api/src/r0/state/send_state_event_for_key.rs @@ -37,7 +37,7 @@ ruma_api! { response: { /// A unique identifier for the event. - pub event_id: &'a EventId, + pub event_id: EventId, } error: crate::Error diff --git a/ruma-client-api/src/r0/user_directory/search_users.rs b/ruma-client-api/src/r0/user_directory/search_users.rs index 1dbbb17b..ce847a21 100644 --- a/ruma-client-api/src/r0/user_directory/search_users.rs +++ b/ruma-client-api/src/r0/user_directory/search_users.rs @@ -1,9 +1,9 @@ //! [POST /_matrix/client/r0/user_directory/search](https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-user-directory-search) use js_int::{uint, UInt}; -use ruma_api::{ruma_api, Outgoing}; +use ruma_api::ruma_api; use ruma_identifiers::UserId; -use serde::Serialize; +use serde::{Deserialize, Serialize}; ruma_api! { metadata: { @@ -28,7 +28,7 @@ ruma_api! { response: { /// Ordered by rank and then whether or not profile info is available. - pub results: &'a [User<'a>], + pub results: Vec, /// Indicates if the result list has been truncated by the limit. pub limited: bool, @@ -46,16 +46,16 @@ fn is_default_limit(limit: &UInt) -> bool { } /// User data as result of a search. -#[derive(Clone, Debug, Outgoing, Serialize)] -pub struct User<'a> { +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct User { /// The user's matrix user ID. - pub user_id: &'a UserId, + pub user_id: UserId, /// The display name of the user, if one exists. #[serde(skip_serializing_if = "Option::is_none")] - pub display_name: Option<&'a str>, + pub display_name: Option, /// The avatar url, as an MXC, if one exists. #[serde(skip_serializing_if = "Option::is_none")] - pub avatar_url: Option<&'a str>, + pub avatar_url: Option, }