Derive Clone, Copy, and Debug for Endpoint structs.

This commit is contained in:
Jimmy Cuadra 2016-12-30 23:13:19 -08:00
parent 130a4b5a98
commit 0535405ae6
22 changed files with 60 additions and 0 deletions

View File

@ -3,6 +3,7 @@
//! shared by client and server code.
#![feature(proc_macro)]
#![deny(missing_debug_implementations)]
#![warn(missing_docs)]
extern crate ruma_api;

View File

@ -13,6 +13,7 @@ pub mod register {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's query string parameters.
@ -72,6 +73,7 @@ pub mod request_password_change_token {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {
@ -97,6 +99,7 @@ pub mod request_password_change_token {
/// [POST /_matrix/client/r0/account/deactivate](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-account-deactivate)
pub mod deactivate {
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {
@ -128,6 +131,7 @@ pub mod change_password {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {
@ -163,6 +167,7 @@ pub mod request_register_token {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {

View File

@ -13,6 +13,7 @@ pub mod create_alias {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {
@ -38,6 +39,7 @@ pub mod create_alias {
/// [DELETE /_matrix/client/r0/directory/room/:room_alias](https://matrix.org/docs/spec/client_server/r0.2.0.html#delete-matrix-client-r0-directory-room-roomalias)
pub mod delete_alias {
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {
@ -65,6 +67,7 @@ pub mod get_alias {
use ruma_identifiers::RoomId;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's response.

View File

@ -5,6 +5,7 @@ pub mod set_room_account_data {
use ruma_identifiers::{RoomId, UserId};
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -45,6 +46,7 @@ pub mod set_global_account_data {
use ruma_identifiers::UserId;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.

View File

@ -11,6 +11,7 @@ pub mod create_contact {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// The third party credentials to associate with the account.
@ -44,6 +45,7 @@ pub mod create_contact {
/// [GET /_matrix/client/r0/account/3pid](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-account-3pid)
pub mod get_contacts {
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// The medium of third party identifier.
@ -99,6 +101,7 @@ pub mod request_contact_verification_token {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {

View File

@ -7,6 +7,7 @@ pub mod get_context {
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.

View File

@ -29,6 +29,7 @@ pub mod get_public_rooms {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {

View File

@ -100,6 +100,7 @@ pub mod create_filter {
use super::FilterDefinition;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -143,6 +144,7 @@ pub mod get_filter {
use super::FilterDefinition;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.

View File

@ -3,6 +3,7 @@
/// [GET /_matrix/media/r0/download/{serverName}/{mediaId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-media-r0-download-servername-mediaid)
pub mod get_content {
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -41,6 +42,7 @@ pub mod get_content {
/// [POST /_matrix/media/r0/upload](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-media-r0-upload)
pub mod create_content {
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's response.
@ -75,6 +77,7 @@ pub mod get_content_thumbnail {
use std::fmt::{Display, Error as FmtError, Formatter};
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// The desired resizing method.
@ -87,6 +90,7 @@ pub mod get_content_thumbnail {
}
/// This API endpoint's path parameters.
#[derive(Clone, Debug)]
pub struct PathParams {
/// The media ID from the mxc:// URI (the path component).
pub media_id: String,

View File

@ -26,6 +26,7 @@ pub mod invite_user {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -70,6 +71,7 @@ pub mod join_room_by_id_or_alias {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// The response type.
@ -130,6 +132,7 @@ pub mod join_room_by_id {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// The response type.
@ -172,6 +175,7 @@ pub mod forget_room {
use ruma_identifiers::RoomId;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -208,6 +212,7 @@ pub mod leave_room {
use ruma_identifiers::RoomId;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -252,6 +257,7 @@ pub mod kick_user {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -294,6 +300,7 @@ pub mod unban_user {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -338,6 +345,7 @@ pub mod ban_user {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.

View File

@ -6,6 +6,7 @@ pub mod set_presence {
use ruma_events::presence::PresenceState;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -51,6 +52,7 @@ pub mod get_presence {
use ruma_events::presence::PresenceState;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -99,6 +101,7 @@ pub mod update_presence_subscriptions {
use ruma_identifiers::UserId;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -147,6 +150,7 @@ pub mod get_subscribed_presences {
use ruma_events::presence::PresenceEvent;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.

View File

@ -18,6 +18,7 @@ pub mod get_display_name {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {
@ -62,6 +63,7 @@ pub mod set_display_name {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {
@ -105,6 +107,7 @@ pub mod get_avatar_url {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {
@ -148,6 +151,7 @@ pub mod set_avatar_url {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {
@ -193,6 +197,7 @@ pub mod get_profile {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {

View File

@ -7,6 +7,7 @@ pub mod create_receipt {
use std::fmt::{Display, Error as FmtError, Formatter};
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This endpoint's path parameters.

View File

@ -5,6 +5,7 @@ pub mod redact_event {
use ruma_identifiers::{RoomId, EventId};
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.

View File

@ -33,6 +33,7 @@ pub mod create_room {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// The response type.

View File

@ -6,6 +6,7 @@ pub mod send_state_event {
use ruma_events::EventType;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -52,6 +53,7 @@ pub mod send_state_event_by_state_key {
use ruma_events::EventType;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -100,6 +102,7 @@ pub mod send_message_event {
use ruma_events::EventType;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.

View File

@ -3,6 +3,7 @@
/// [POST /_matrix/client/r0/login](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-login)
pub mod login {
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's response.
@ -38,6 +39,7 @@ pub mod login {
/// [POST /_matrix/client/r0/logout](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-logout)
pub mod logout {
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
impl ::Endpoint for Endpoint {
@ -69,6 +71,7 @@ pub mod refresh_access_token {
}
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's response.

View File

@ -6,6 +6,7 @@ pub mod get_state_events {
use ruma_events::collections::only;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -42,6 +43,7 @@ pub mod get_state_event_by_event_type {
use ruma_identifiers::RoomId;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -80,6 +82,7 @@ pub mod get_state_event_by_state_key {
use ruma_identifiers::RoomId;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -121,6 +124,7 @@ pub mod get_member_events {
use ruma_events::room::member::MemberEvent;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -164,6 +168,7 @@ pub mod get_message_events {
use ruma_events::collections::only;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -233,6 +238,7 @@ pub mod sync_events {
use r0::filter::FilterDefinition;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// Whether to set presence or not during sync.

View File

@ -6,6 +6,7 @@ pub mod create_tag {
use ruma_events::tag::TagInfo;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -47,6 +48,7 @@ pub mod get_tags {
use ruma_events::tag::TagEventContent;
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.
@ -91,6 +93,7 @@ pub mod delete_tag {
use ruma_identifiers::{UserId, RoomId};
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.

View File

@ -5,6 +5,7 @@ pub mod start_or_stop_typing {
use ruma_identifiers::{UserId, RoomId};
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.

View File

@ -3,6 +3,7 @@
/// [GET /_matrix/client/r0/voip/turnServer](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-voip-turnserver)
pub mod get_turn_server_info {
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's path parameters.

View File

@ -1,4 +1,5 @@
/// Details about this API endpoint.
#[derive(Clone, Copy, Debug)]
pub struct Endpoint;
/// This API endpoint's response.