Re-run 'cargo fmt'
This commit is contained in:
parent
7a7697e9e2
commit
586bca680d
@ -15,7 +15,8 @@ extern crate ruma_identifiers;
|
|||||||
extern crate ruma_signatures;
|
extern crate ruma_signatures;
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
#[macro_use] extern crate serde_derive;
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
extern crate serde_urlencoded;
|
extern crate serde_urlencoded;
|
||||||
extern crate url;
|
extern crate url;
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ pub mod register {
|
|||||||
#[serde(rename = "type")]
|
#[serde(rename = "type")]
|
||||||
kind: String,
|
kind: String,
|
||||||
/// The value of the session key given by the homeserver.
|
/// The value of the session key given by the homeserver.
|
||||||
session: Option<String>
|
session: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The kind of account being registered.
|
/// The kind of account being registered.
|
||||||
@ -90,10 +90,10 @@ pub mod register {
|
|||||||
/// A guest account
|
/// A guest account
|
||||||
///
|
///
|
||||||
/// These accounts may have limited permissions and may not be supported by all servers.
|
/// These accounts may have limited permissions and may not be supported by all servers.
|
||||||
#[serde(rename="guest")]
|
#[serde(rename = "guest")]
|
||||||
Guest,
|
Guest,
|
||||||
/// A regular user account
|
/// A regular user account
|
||||||
#[serde(rename="user")]
|
#[serde(rename = "user")]
|
||||||
User,
|
User,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ pub mod set_room_account_data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// [PUT /_matrix/client/r0/user/{userId}/account_data/{type}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-user-userid-account-data-type)
|
/// [PUT /_matrix/client/r0/user/{userId}/account_data/{type}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-user-userid-account-data-type)
|
||||||
pub mod set_global_account_data {
|
pub mod set_global_account_data {
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_identifiers::UserId;
|
use ruma_identifiers::UserId;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
@ -67,7 +67,7 @@ pub mod get_contacts {
|
|||||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||||
pub enum Medium {
|
pub enum Medium {
|
||||||
/// An email address.
|
/// An email address.
|
||||||
#[serde(rename="email")]
|
#[serde(rename = "email")]
|
||||||
Email,
|
Email,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
/// [GET /_matrix/client/r0/rooms/{roomId}/context/{eventId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-context-eventid)
|
/// [GET /_matrix/client/r0/rooms/{roomId}/context/{eventId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-context-eventid)
|
||||||
pub mod get_context {
|
pub mod get_context {
|
||||||
use ruma_identifiers::{EventId, RoomId};
|
|
||||||
use ruma_events::collections::only;
|
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
|
use ruma_events::collections::only;
|
||||||
|
use ruma_identifiers::{EventId, RoomId};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata {
|
metadata {
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
/// [GET /_matrix/client/r0/publicRooms](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-publicrooms)
|
/// [GET /_matrix/client/r0/publicRooms](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-publicrooms)
|
||||||
pub mod get_public_rooms {
|
pub mod get_public_rooms {
|
||||||
use ruma_identifiers::{RoomId, RoomAliasId};
|
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
|
use ruma_identifiers::{RoomAliasId, RoomId};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata {
|
metadata {
|
||||||
|
@ -22,7 +22,7 @@ pub struct ThirdPartySigned {
|
|||||||
/// [POST /_matrix/client/r0/rooms/{roomId}/invite](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-invite)
|
/// [POST /_matrix/client/r0/rooms/{roomId}/invite](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-invite)
|
||||||
pub mod invite_user {
|
pub mod invite_user {
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_identifiers::{UserId, RoomId};
|
use ruma_identifiers::{RoomId, UserId};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata {
|
metadata {
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
/// [PUT /_matrix/client/r0/presence/{userId}/status](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-presence-userid-status)
|
/// [PUT /_matrix/client/r0/presence/{userId}/status](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-presence-userid-status)
|
||||||
pub mod set_presence {
|
pub mod set_presence {
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_identifiers::UserId;
|
|
||||||
use ruma_events::presence::PresenceState;
|
use ruma_events::presence::PresenceState;
|
||||||
|
use ruma_identifiers::UserId;
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata {
|
metadata {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
/// [PUT /_matrix/client/r0/rooms/{roomId}/redact/{eventId}/{txnId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-redact-eventid-txnid)
|
/// [PUT /_matrix/client/r0/rooms/{roomId}/redact/{eventId}/{txnId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-redact-eventid-txnid)
|
||||||
pub mod redact_event {
|
pub mod redact_event {
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_identifiers::{RoomId, EventId};
|
use ruma_identifiers::{EventId, RoomId};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata {
|
metadata {
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
/// [POST /_matrix/client/r0/createRoom](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-createroom)
|
/// [POST /_matrix/client/r0/createRoom](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-createroom)
|
||||||
pub mod create_room {
|
pub mod create_room {
|
||||||
use ruma_identifiers::{RoomId, UserId};
|
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
|
use ruma_identifiers::{RoomId, UserId};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata {
|
metadata {
|
||||||
@ -59,7 +59,7 @@ pub mod create_room {
|
|||||||
/// Whether users on other servers can join this room.
|
/// Whether users on other servers can join this room.
|
||||||
///
|
///
|
||||||
/// Defaults to `true` if key does not exist.
|
/// Defaults to `true` if key does not exist.
|
||||||
#[serde(rename="m.federate")]
|
#[serde(rename = "m.federate")]
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub federate: Option<bool>,
|
pub federate: Option<bool>,
|
||||||
}
|
}
|
||||||
@ -68,13 +68,13 @@ pub mod create_room {
|
|||||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||||
pub enum RoomPreset {
|
pub enum RoomPreset {
|
||||||
/// `join_rules` is set to `invite` and `history_visibility` is set to `shared`.
|
/// `join_rules` is set to `invite` and `history_visibility` is set to `shared`.
|
||||||
#[serde(rename="private_chat")]
|
#[serde(rename = "private_chat")]
|
||||||
PrivateChat,
|
PrivateChat,
|
||||||
/// `join_rules` is set to `public` and `history_visibility` is set to `shared`.
|
/// `join_rules` is set to `public` and `history_visibility` is set to `shared`.
|
||||||
#[serde(rename="public_chat")]
|
#[serde(rename = "public_chat")]
|
||||||
PublicChat,
|
PublicChat,
|
||||||
/// Same as `PrivateChat`, but all initial invitees get the same power level as the creator.
|
/// Same as `PrivateChat`, but all initial invitees get the same power level as the creator.
|
||||||
#[serde(rename="trusted_private_chat")]
|
#[serde(rename = "trusted_private_chat")]
|
||||||
TrustedPrivateChat,
|
TrustedPrivateChat,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ pub mod search_events {
|
|||||||
pub struct Categories {
|
pub struct Categories {
|
||||||
/// Criteria for searching a category of events.
|
/// Criteria for searching a category of events.
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub room_events: Option<Criteria>
|
pub room_events: Option<Criteria>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Criteria for searching a category of events.
|
/// Criteria for searching a category of events.
|
||||||
@ -107,17 +107,17 @@ pub mod search_events {
|
|||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct Grouping {
|
pub struct Grouping {
|
||||||
/// The key within events to use for this grouping.
|
/// The key within events to use for this grouping.
|
||||||
pub key: GroupingKey
|
pub key: GroupingKey,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The key within events to use for this grouping.
|
/// The key within events to use for this grouping.
|
||||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||||
pub enum GroupingKey {
|
pub enum GroupingKey {
|
||||||
/// `room_id`
|
/// `room_id`
|
||||||
#[serde(rename="room_id")]
|
#[serde(rename = "room_id")]
|
||||||
RoomId,
|
RoomId,
|
||||||
/// `sender`
|
/// `sender`
|
||||||
#[serde(rename="sender")]
|
#[serde(rename = "sender")]
|
||||||
Sender,
|
Sender,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,13 +132,13 @@ pub mod search_events {
|
|||||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||||
pub enum SearchKeys {
|
pub enum SearchKeys {
|
||||||
/// content.body
|
/// content.body
|
||||||
#[serde(rename="content.body")]
|
#[serde(rename = "content.body")]
|
||||||
ContentBody,
|
ContentBody,
|
||||||
/// content.name
|
/// content.name
|
||||||
#[serde(rename="content.name")]
|
#[serde(rename = "content.name")]
|
||||||
ContentName,
|
ContentName,
|
||||||
/// content.topic
|
/// content.topic
|
||||||
#[serde(rename="content.topic")]
|
#[serde(rename = "content.topic")]
|
||||||
ContentTopic,
|
ContentTopic,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,10 +147,10 @@ pub mod search_events {
|
|||||||
pub enum OrderBy {
|
pub enum OrderBy {
|
||||||
/// Prioritize events by a numerical ranking of how closely they matched the search
|
/// Prioritize events by a numerical ranking of how closely they matched the search
|
||||||
/// criteria.
|
/// criteria.
|
||||||
#[serde(rename="rank")]
|
#[serde(rename = "rank")]
|
||||||
Rank,
|
Rank,
|
||||||
/// Prioritize recent events.
|
/// Prioritize recent events.
|
||||||
#[serde(rename="recent")]
|
#[serde(rename = "recent")]
|
||||||
Recent,
|
Recent,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
/// [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype)
|
/// [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype)
|
||||||
pub mod send_state_event_for_empty_key {
|
pub mod send_state_event_for_empty_key {
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_identifiers::{RoomId, EventId};
|
|
||||||
use ruma_events::EventType;
|
use ruma_events::EventType;
|
||||||
|
use ruma_identifiers::{EventId, RoomId};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
@ -39,8 +39,8 @@ pub mod send_state_event_for_empty_key {
|
|||||||
/// [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype-statekey)
|
/// [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype-statekey)
|
||||||
pub mod send_state_event_for_key {
|
pub mod send_state_event_for_key {
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_identifiers::{RoomId, EventId};
|
|
||||||
use ruma_events::EventType;
|
use ruma_events::EventType;
|
||||||
|
use ruma_identifiers::{EventId, RoomId};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
@ -78,9 +78,9 @@ pub mod send_state_event_for_key {
|
|||||||
/// [PUT /_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid)
|
/// [PUT /_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid)
|
||||||
pub mod send_message_event {
|
pub mod send_message_event {
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_identifiers::{RoomId, EventId};
|
|
||||||
use ruma_events::EventType;
|
|
||||||
use ruma_events::room::message::MessageEventContent;
|
use ruma_events::room::message::MessageEventContent;
|
||||||
|
use ruma_events::EventType;
|
||||||
|
use ruma_identifiers::{EventId, RoomId};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata {
|
metadata {
|
||||||
|
@ -186,10 +186,10 @@ pub mod get_message_events {
|
|||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub enum Direction {
|
pub enum Direction {
|
||||||
/// Return events backwards in time from the requested `from` token.
|
/// Return events backwards in time from the requested `from` token.
|
||||||
#[serde(rename="b")]
|
#[serde(rename = "b")]
|
||||||
Backward,
|
Backward,
|
||||||
/// Return events forwards in time from the requested `from` token.
|
/// Return events forwards in time from the requested `from` token.
|
||||||
#[serde(rename="f")]
|
#[serde(rename = "f")]
|
||||||
Forward,
|
Forward,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -199,7 +199,10 @@ pub mod sync_events {
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_events::{collections::{all, only}, stripped};
|
use ruma_events::{
|
||||||
|
collections::{all, only},
|
||||||
|
stripped,
|
||||||
|
};
|
||||||
use ruma_identifiers::RoomId;
|
use ruma_identifiers::RoomId;
|
||||||
|
|
||||||
use r0::filter::FilterDefinition;
|
use r0::filter::FilterDefinition;
|
||||||
@ -252,7 +255,7 @@ pub mod sync_events {
|
|||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub enum SetPresence {
|
pub enum SetPresence {
|
||||||
/// Do not set the presence of the user calling this API.
|
/// Do not set the presence of the user calling this API.
|
||||||
#[serde(rename="offline")]
|
#[serde(rename = "offline")]
|
||||||
Offline,
|
Offline,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
pub mod create_tag {
|
pub mod create_tag {
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_events::tag::TagInfo;
|
use ruma_events::tag::TagInfo;
|
||||||
use ruma_identifiers::{UserId, RoomId};
|
use ruma_identifiers::{RoomId, UserId};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata {
|
metadata {
|
||||||
@ -39,7 +39,7 @@ pub mod create_tag {
|
|||||||
pub mod get_tags {
|
pub mod get_tags {
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_events::tag::TagEventContent;
|
use ruma_events::tag::TagEventContent;
|
||||||
use ruma_identifiers::{UserId, RoomId};
|
use ruma_identifiers::{RoomId, UserId};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata {
|
metadata {
|
||||||
@ -70,7 +70,7 @@ pub mod get_tags {
|
|||||||
/// [DELETE /_matrix/client/r0/user/{userId}/rooms/{roomId}/tags/{tag}](https://matrix.org/docs/spec/client_server/r0.2.0.html#delete-matrix-client-r0-user-userid-rooms-roomid-tags-tag)
|
/// [DELETE /_matrix/client/r0/user/{userId}/rooms/{roomId}/tags/{tag}](https://matrix.org/docs/spec/client_server/r0.2.0.html#delete-matrix-client-r0-user-userid-rooms-roomid-tags-tag)
|
||||||
pub mod delete_tag {
|
pub mod delete_tag {
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_identifiers::{UserId, RoomId};
|
use ruma_identifiers::{RoomId, UserId};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata {
|
metadata {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
/// [PUT /_matrix/client/r0/rooms/{roomId}/typing/{userId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-typing-userid)
|
/// [PUT /_matrix/client/r0/rooms/{roomId}/typing/{userId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-typing-userid)
|
||||||
pub mod create_typing_event {
|
pub mod create_typing_event {
|
||||||
use ruma_api_macros::ruma_api;
|
use ruma_api_macros::ruma_api;
|
||||||
use ruma_identifiers::{UserId, RoomId};
|
use ruma_identifiers::{RoomId, UserId};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata {
|
metadata {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user