Remove lots of Copy implementations
so we don't have do breaking releases once they can't be Copy anymore.
This commit is contained in:
parent
25d283fa81
commit
19ae6ff347
@ -2,7 +2,7 @@
|
||||
//! endpoint in the [Matrix](https://matrix.org/) application service API specification. These
|
||||
//! types can be shared by application service and server code.
|
||||
|
||||
#![warn(missing_copy_implementations, missing_debug_implementations, missing_docs)]
|
||||
#![warn(missing_debug_implementations, missing_docs)]
|
||||
|
||||
pub mod event;
|
||||
pub mod query;
|
||||
|
@ -2,7 +2,7 @@
|
||||
//! endpoint in the [Matrix](https://matrix.org/) client API specification. These types can be
|
||||
//! shared by client and server code.
|
||||
|
||||
#![warn(missing_copy_implementations, missing_debug_implementations, missing_docs)]
|
||||
#![warn(missing_debug_implementations, missing_docs)]
|
||||
|
||||
pub mod error;
|
||||
pub mod r0;
|
||||
|
@ -100,7 +100,7 @@ impl Response {
|
||||
}
|
||||
|
||||
/// The kind of account being registered.
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum RegistrationKind {
|
||||
/// A guest account
|
||||
|
@ -83,10 +83,10 @@ impl Capabilities {
|
||||
}
|
||||
|
||||
/// Information about the m.change_password capability
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct ChangePasswordCapability {
|
||||
/// True if the user can change their password, false otherwise.
|
||||
/// `true` if the user can change their password, `false` otherwise.
|
||||
pub enabled: bool,
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ impl Default for EventFormat {
|
||||
}
|
||||
|
||||
/// Filters to be applied to room events.
|
||||
#[derive(Clone, Copy, Debug, Default, Outgoing, Serialize)]
|
||||
#[derive(Clone, Debug, Default, Outgoing, Serialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[incoming_derive(Clone, Default, Serialize)]
|
||||
pub struct RoomEventFilter<'a> {
|
||||
@ -142,7 +142,7 @@ impl IncomingRoomEventFilter {
|
||||
}
|
||||
|
||||
/// Filters to be applied to room data.
|
||||
#[derive(Clone, Copy, Debug, Default, Outgoing, Serialize)]
|
||||
#[derive(Clone, Debug, Default, Outgoing, Serialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[incoming_derive(Clone, Default, Serialize)]
|
||||
pub struct RoomFilter<'a> {
|
||||
@ -224,7 +224,7 @@ impl IncomingRoomFilter {
|
||||
}
|
||||
|
||||
/// Filter for non-room data.
|
||||
#[derive(Clone, Copy, Debug, Default, Outgoing, Serialize)]
|
||||
#[derive(Clone, Debug, Default, Outgoing, Serialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[incoming_derive(Clone, Default, Serialize)]
|
||||
pub struct Filter<'a> {
|
||||
|
@ -54,7 +54,7 @@ pub struct CrossSigningKey {
|
||||
}
|
||||
|
||||
/// The usage of a cross signing key.
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum KeyUsage {
|
||||
/// Master key.
|
||||
|
@ -120,7 +120,7 @@ fn is_default_limit(val: &UInt) -> bool {
|
||||
}
|
||||
|
||||
/// The direction to return events from.
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub enum Direction {
|
||||
/// Return events backwards in time from the requested `from` token.
|
||||
#[serde(rename = "b")]
|
||||
|
@ -118,7 +118,7 @@ impl<'a> Criteria<'a> {
|
||||
}
|
||||
|
||||
/// Configures whether any context for the events returned are included in the response.
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct EventContext {
|
||||
/// How many events before the result are returned.
|
||||
@ -250,7 +250,7 @@ pub enum GroupingKey {
|
||||
}
|
||||
|
||||
/// Requests that the server partitions the result set based on the provided list of keys.
|
||||
#[derive(Clone, Copy, Default, Debug, Outgoing, Serialize)]
|
||||
#[derive(Clone, Default, Debug, Outgoing, Serialize)]
|
||||
#[incoming_derive(Default)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct Groupings<'a> {
|
||||
|
@ -39,7 +39,7 @@ impl Response {
|
||||
}
|
||||
|
||||
/// An authentication mechanism.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum LoginType {
|
||||
/// A password is supplied to authenticate.
|
||||
|
@ -107,7 +107,7 @@ pub enum UserInfo<'a> {
|
||||
}
|
||||
|
||||
/// The authentication mechanism.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Outgoing, Serialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Outgoing, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum LoginInfo<'a> {
|
||||
/// A password is supplied to authenticate.
|
||||
|
@ -264,7 +264,7 @@ impl JoinedRoom {
|
||||
}
|
||||
|
||||
/// unread notifications count
|
||||
#[derive(Clone, Copy, Default, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Default, Debug, Deserialize, Serialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct UnreadNotificationsCount {
|
||||
/// The number of unread notifications for this room with the highlight flag set.
|
||||
|
@ -98,7 +98,7 @@
|
||||
//! ```
|
||||
|
||||
#![warn(rust_2018_idioms)]
|
||||
#![deny(missing_copy_implementations, missing_debug_implementations, missing_docs)]
|
||||
#![deny(missing_debug_implementations, missing_docs)]
|
||||
|
||||
use std::{
|
||||
convert::TryFrom,
|
||||
|
@ -19,7 +19,7 @@ impl Display for InvalidInput {
|
||||
impl Error for InvalidInput {}
|
||||
|
||||
/// An error when attempting to create a value from a string via the `FromStr` trait.
|
||||
#[derive(Clone, Copy, Eq, Debug, Hash, PartialEq)]
|
||||
#[derive(Clone, Eq, Debug, Hash, PartialEq)]
|
||||
pub struct FromStrError;
|
||||
|
||||
impl Display for FromStrError {
|
||||
|
@ -116,7 +116,7 @@ pub struct SignedContent {
|
||||
}
|
||||
|
||||
/// Translation of the membership change in `m.room.member` event.
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub enum MembershipChange {
|
||||
/// No change.
|
||||
|
@ -127,7 +127,7 @@ impl Default for PowerLevelsEventContent {
|
||||
}
|
||||
|
||||
/// The power level requirements for specific notification types.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
|
||||
pub struct NotificationPowerLevels {
|
||||
/// The level required to trigger an `@room` notification.
|
||||
#[cfg_attr(
|
||||
|
@ -1,12 +1,7 @@
|
||||
//! Crate **ruma_identifiers** contains types for [Matrix](https://matrix.org/) identifiers
|
||||
//! for events, rooms, room aliases, room versions, and users.
|
||||
|
||||
#![warn(
|
||||
rust_2018_idioms,
|
||||
missing_copy_implementations,
|
||||
missing_debug_implementations,
|
||||
missing_docs
|
||||
)]
|
||||
#![warn(rust_2018_idioms, missing_debug_implementations, missing_docs)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
||||
// Renamed in `Cargo.toml` so we can have a serde feature.
|
||||
|
@ -154,7 +154,7 @@ impl Default for NotificationPriority {
|
||||
}
|
||||
|
||||
/// Type for passing information about notification counts.
|
||||
#[derive(Clone, Copy, Debug, Default, Deserialize, Serialize, PartialEq)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct NotificationCounts {
|
||||
/// The number of unread messages a user has across all of the rooms they
|
||||
|
@ -42,7 +42,7 @@
|
||||
//! these respective functions for more details and full examples of use.
|
||||
|
||||
#![warn(rust_2018_idioms)]
|
||||
#![deny(missing_copy_implementations, missing_debug_implementations, missing_docs)]
|
||||
#![deny(missing_debug_implementations, missing_docs)]
|
||||
|
||||
use std::{
|
||||
error::Error as StdError,
|
||||
@ -117,7 +117,7 @@ impl From<ruma_serde::CanonicalJsonError> for Error {
|
||||
}
|
||||
|
||||
/// The algorithm used for signing data.
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, AsRefStr, DisplayAsRefStr)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq, AsRefStr, DisplayAsRefStr)]
|
||||
#[ruma_enum(rename_all = "snake_case")]
|
||||
pub enum Algorithm {
|
||||
/// The Ed25519 digital signature algorithm.
|
||||
|
@ -62,8 +62,8 @@ impl Signature {
|
||||
}
|
||||
|
||||
/// The algorithm used to generate the signature.
|
||||
pub fn algorithm(&self) -> Algorithm {
|
||||
self.algorithm
|
||||
pub fn algorithm(&self) -> &Algorithm {
|
||||
&self.algorithm
|
||||
}
|
||||
|
||||
/// The raw bytes of the signature.
|
||||
|
@ -23,7 +23,7 @@ pub trait Verifier {
|
||||
}
|
||||
|
||||
/// A verifier for Ed25519 digital signatures.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq)]
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
pub struct Ed25519Verifier;
|
||||
|
||||
impl Verifier for Ed25519Verifier {
|
||||
@ -46,7 +46,7 @@ impl Verifier for Ed25519Verifier {
|
||||
/// calculated during verification. This is not necessarily an error condition, as it may indicate
|
||||
/// that the event has been redacted. In this case, receiving homeservers should store a redacted
|
||||
/// version of the event.
|
||||
#[derive(Debug, Clone, Copy, Hash, PartialEq)]
|
||||
#[derive(Clone, Debug, Hash, PartialEq)]
|
||||
pub enum Verified {
|
||||
/// All signatures are valid and the content hashes match.
|
||||
All,
|
||||
|
Loading…
x
Reference in New Issue
Block a user