Remove now-redundant doc(cfg) attributes
They are now implied: https://github.com/rust-lang/rust/pull/89596
This commit is contained in:
parent
343bb2a67b
commit
271491732e
@ -13,7 +13,6 @@ pub mod directory;
|
||||
pub mod filter;
|
||||
pub mod keys;
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub mod knock;
|
||||
pub mod media;
|
||||
pub mod membership;
|
||||
|
@ -1,6 +1,5 @@
|
||||
//! Endpoints for server-side key backups.
|
||||
#![cfg(feature = "unstable-pre-spec")]
|
||||
#![cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
|
||||
pub mod add_backup_key_session;
|
||||
pub mod add_backup_key_sessions;
|
||||
|
@ -58,7 +58,6 @@ pub struct PublicRoomsChunk {
|
||||
|
||||
/// The joining rule for the room.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub join_rule: Option<JoinRule>,
|
||||
}
|
||||
|
@ -6,8 +6,6 @@ pub mod get_keys;
|
||||
pub mod upload_keys;
|
||||
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub mod upload_signatures;
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub mod upload_signing_keys;
|
||||
|
@ -58,19 +58,16 @@ ruma_api! {
|
||||
|
||||
/// Information on the master cross-signing keys of the queried users.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||
pub master_keys: BTreeMap<UserId, CrossSigningKey>,
|
||||
|
||||
/// Information on the self-signing keys of the queried users.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||
pub self_signing_keys: BTreeMap<UserId, CrossSigningKey>,
|
||||
|
||||
/// Information on the user-signing keys of the queried users.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||
pub user_signing_keys: BTreeMap<UserId, CrossSigningKey>,
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ ruma_api! {
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448).
|
||||
#[ruma_api(query)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(default, skip_serializing_if = "ruma_serde::is_default", rename = "xyz.amorgan.blurhash")]
|
||||
pub generate_blurhash: bool,
|
||||
}
|
||||
@ -47,7 +46,6 @@ ruma_api! {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(rename = "xyz.amorgan.blurhash")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub blurhash: Option<String>,
|
||||
|
@ -35,7 +35,6 @@ ruma_api! {
|
||||
|
||||
/// Optional reason for inviting the user.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ ruma_api! {
|
||||
|
||||
/// Optional reason for joining the room.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ ruma_api! {
|
||||
|
||||
/// Optional reason for joining the room.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ ruma_api! {
|
||||
|
||||
/// Optional reason to be included as the `reason` on the subsequent membership event.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ ruma_api! {
|
||||
|
||||
/// Optional reason for unbanning the user.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub reason: Option<&'a str>,
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ ruma_api! {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(rename = "xyz.amorgan.blurhash")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub blurhash: Option<String>,
|
||||
|
@ -41,7 +41,6 @@ ruma_api! {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(rename = "xyz.amorgan.blurhash")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub blurhash: Option<String>,
|
||||
|
@ -43,7 +43,6 @@ ruma_api! {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(rename = "xyz.amorgan.blurhash")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub blurhash: Option<&'a str>,
|
||||
|
@ -151,7 +151,6 @@ pub struct SsoLoginType {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2858](https://github.com/matrix-org/matrix-doc/pull/2858).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(
|
||||
default,
|
||||
rename = "org.matrix.msc2858.identity_providers",
|
||||
@ -169,7 +168,6 @@ impl SsoLoginType {
|
||||
|
||||
/// An SSO login identity provider.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct IdentityProvider {
|
||||
@ -199,7 +197,6 @@ impl IdentityProvider {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2858](https://github.com/matrix-org/matrix-doc/pull/2858).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub enum IdentityProviderBrand {
|
||||
|
@ -2,7 +2,6 @@
|
||||
//!
|
||||
//! This uses the unstable prefix in [MSC2858](https://github.com/matrix-org/matrix-doc/pull/2858).
|
||||
#![cfg(feature = "unstable-pre-spec")]
|
||||
#![cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
|
||||
use ruma_api::ruma_api;
|
||||
|
||||
|
@ -174,7 +174,6 @@ pub struct Rooms {
|
||||
|
||||
/// The rooms that the user has knocked on.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||
pub knock: BTreeMap<RoomId, KnockedRoom>,
|
||||
}
|
||||
@ -274,7 +273,6 @@ impl JoinedRoom {
|
||||
/// Updates to knocked rooms.
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct KnockedRoom {
|
||||
/// The knock state.
|
||||
@ -284,7 +282,6 @@ pub struct KnockedRoom {
|
||||
/// A mapping from a key `events` to a list of `StrippedStateEvent`.
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct KnockState {
|
||||
/// The list of events.
|
||||
|
@ -57,7 +57,6 @@ pub enum AuthData<'a> {
|
||||
|
||||
/// Registration token-based authentication (`org.matrix.msc3231.login.registration_token`).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
RegistrationToken(RegistrationToken<'a>),
|
||||
|
||||
/// Fallback acknowledgement.
|
||||
@ -377,7 +376,6 @@ pub enum AuthType {
|
||||
|
||||
/// Registration token-based authentication (`org.matrix.msc3231.login.registration_token`).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[ruma_enum(rename = "org.matrix.msc3231.login.registration_token")]
|
||||
RegistrationToken,
|
||||
|
||||
@ -601,7 +599,6 @@ impl IncomingDummy {
|
||||
#[derive(Clone, Debug, Outgoing, Serialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(tag = "type", rename = "org.matrix.msc3231.login.registration_token")]
|
||||
pub struct RegistrationToken<'a> {
|
||||
/// The registration token.
|
||||
@ -612,7 +609,6 @@ pub struct RegistrationToken<'a> {
|
||||
}
|
||||
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
impl<'a> RegistrationToken<'a> {
|
||||
/// Creates a new `RegistrationToken` with the given token.
|
||||
pub fn new(token: &'a str) -> Self {
|
||||
@ -621,7 +617,6 @@ impl<'a> RegistrationToken<'a> {
|
||||
}
|
||||
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
impl IncomingRegistrationToken {
|
||||
/// Convert from `IncomingRegistrationToken` to `RegistrationToken`.
|
||||
fn to_outgoing(&self) -> RegistrationToken<'_> {
|
||||
|
@ -108,7 +108,6 @@ extern crate hyper_rustls_crate as hyper_rustls;
|
||||
extern crate isahc_crate as isahc;
|
||||
|
||||
#[cfg(feature = "client-api")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "client-api")))]
|
||||
mod client_api;
|
||||
mod error;
|
||||
pub mod http_client;
|
||||
|
@ -162,7 +162,6 @@ impl ConditionalPushRule {
|
||||
/// Matches emoji reactions to a message
|
||||
/// MSC2677: Annotations and Reactions
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub fn reaction() -> Self {
|
||||
Self {
|
||||
actions: vec![DontNotify],
|
||||
|
@ -35,28 +35,20 @@ event_enum! {
|
||||
"m.call.hangup",
|
||||
"m.call.candidates",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.key.verification.ready",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.key.verification.start",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.key.verification.cancel",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.key.verification.accept",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.key.verification.key",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.key.verification.mac",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.key.verification.done",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.reaction",
|
||||
"m.room.encrypted",
|
||||
"m.room.message",
|
||||
@ -88,10 +80,8 @@ event_enum! {
|
||||
"m.room.tombstone",
|
||||
"m.room.topic",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.space.child",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.space.parent",
|
||||
}
|
||||
|
||||
@ -103,7 +93,6 @@ event_enum! {
|
||||
"m.forwarded_room_key",
|
||||
"m.key.verification.request",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.key.verification.ready",
|
||||
"m.key.verification.start",
|
||||
"m.key.verification.cancel",
|
||||
@ -111,14 +100,11 @@ event_enum! {
|
||||
"m.key.verification.key",
|
||||
"m.key.verification.mac",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.key.verification.done",
|
||||
"m.room.encrypted",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.secret.request",
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
"m.secret.send",
|
||||
}
|
||||
}
|
||||
|
@ -13,12 +13,10 @@ use serde::{Deserialize, Serialize};
|
||||
pub mod accept;
|
||||
pub mod cancel;
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub mod done;
|
||||
pub mod key;
|
||||
pub mod mac;
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub mod ready;
|
||||
pub mod request;
|
||||
pub mod start;
|
||||
@ -123,7 +121,6 @@ impl ShortAuthenticationString {
|
||||
/// A relation which associates an `m.key.verification.request` with another key verification event.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[serde(tag = "rel_type", rename = "m.reference")]
|
||||
pub struct Relation {
|
||||
|
@ -43,7 +43,6 @@ impl ToDeviceKeyVerificationAcceptEventContent {
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, EventContent)]
|
||||
#[ruma_event(type = "m.key.verification.accept", kind = Message)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct KeyVerificationAcceptEventContent {
|
||||
/// The method specific content.
|
||||
|
@ -39,7 +39,6 @@ impl ToDeviceKeyVerificationCancelEventContent {
|
||||
/// Cancels a key verification process/request.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, EventContent)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[ruma_event(type = "m.key.verification.cancel", kind = Message)]
|
||||
pub struct KeyVerificationCancelEventContent {
|
||||
|
@ -35,7 +35,6 @@ impl ToDeviceKeyVerificationKeyEventContent {
|
||||
/// Sends the ephemeral public key for a device to the partner device.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, EventContent)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[ruma_event(type = "m.key.verification.key", kind = Message)]
|
||||
pub struct KeyVerificationKeyEventContent {
|
||||
|
@ -43,7 +43,6 @@ impl ToDeviceKeyVerificationMacEventContent {
|
||||
/// Sends the MAC of a device's key to the partner device.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, EventContent)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[ruma_event(type = "m.key.verification.mac", kind = Message)]
|
||||
pub struct KeyVerificationMacEventContent {
|
||||
|
@ -48,7 +48,6 @@ impl ToDeviceKeyVerificationStartEventContent {
|
||||
/// Begins an SAS key verification process.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, EventContent)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[ruma_event(type = "m.key.verification.start", kind = Message)]
|
||||
pub struct KeyVerificationStartEventContent {
|
||||
|
@ -162,33 +162,27 @@ pub mod fully_read;
|
||||
pub mod ignored_user_list;
|
||||
pub mod key;
|
||||
#[cfg(feature = "unstable-pdu")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pdu")))]
|
||||
pub mod pdu;
|
||||
pub mod policy;
|
||||
pub mod presence;
|
||||
pub mod push_rules;
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub mod reaction;
|
||||
pub mod receipt;
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub mod relation;
|
||||
pub mod room;
|
||||
pub mod room_key;
|
||||
pub mod room_key_request;
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub mod secret;
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub mod space;
|
||||
pub mod sticker;
|
||||
pub mod tag;
|
||||
pub mod typing;
|
||||
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub use self::relation::Relations;
|
||||
pub use self::{
|
||||
enums::*,
|
||||
|
@ -44,7 +44,6 @@ pub struct RoomV1Pdu {
|
||||
pub sender: UserId,
|
||||
|
||||
#[cfg(not(feature = "unstable-pre-spec"))]
|
||||
#[cfg_attr(docsrs, doc(cfg(not(feature = "unstable-pre-spec"))))]
|
||||
/// The `server_name` of the homeserver that created this event.
|
||||
pub origin: String,
|
||||
|
||||
@ -104,7 +103,6 @@ pub struct RoomV3Pdu {
|
||||
pub sender: UserId,
|
||||
|
||||
#[cfg(not(feature = "unstable-pre-spec"))]
|
||||
#[cfg_attr(docsrs, doc(cfg(not(feature = "unstable-pre-spec"))))]
|
||||
/// The `server_name` of the homeserver that created this event.
|
||||
pub origin: String,
|
||||
|
||||
|
@ -65,7 +65,6 @@ pub struct ImageInfo {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(rename = "xyz.amorgan.blurhash")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub blurhash: Option<String>,
|
||||
|
@ -85,7 +85,6 @@ pub struct ImageInfo {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(rename = "xyz.amorgan.blurhash")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub blurhash: Option<String>,
|
||||
|
@ -96,17 +96,14 @@ pub enum Relation {
|
||||
|
||||
/// An event that replaces another event.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
Replacement(Replacement),
|
||||
|
||||
/// A reference to another event.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
Reference(Reference),
|
||||
|
||||
/// An annotation to an event.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
Annotation(Annotation),
|
||||
|
||||
#[doc(hidden)]
|
||||
@ -119,7 +116,6 @@ pub enum Relation {
|
||||
/// is part of the encrypted content of an `m.room.encrypted` events.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct Replacement {
|
||||
/// The ID of the event being replacing.
|
||||
@ -129,7 +125,6 @@ pub struct Replacement {
|
||||
/// A reference to another event.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct Reference {
|
||||
/// The event we are referencing.
|
||||
@ -147,7 +142,6 @@ impl Reference {
|
||||
/// An annotation for an event.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct Annotation {
|
||||
/// The event that is being annotated.
|
||||
|
@ -74,7 +74,6 @@ pub struct RoomMemberEventContent {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(rename = "xyz.amorgan.blurhash")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub blurhash: Option<String>,
|
||||
@ -90,7 +89,6 @@ pub struct RoomMemberEventContent {
|
||||
/// the potential for spam and abuse. Hiding the reason behind a button or other component
|
||||
/// is recommended.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub reason: Option<String>,
|
||||
}
|
||||
|
@ -173,7 +173,6 @@ pub enum MessageType {
|
||||
|
||||
/// A request to initiate a key verification.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
VerificationRequest(KeyVerificationRequestEventContent),
|
||||
|
||||
/// A custom message.
|
||||
@ -311,7 +310,6 @@ pub enum Relation {
|
||||
|
||||
/// An event that replaces another event.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
Replacement(Replacement),
|
||||
|
||||
#[doc(hidden)]
|
||||
@ -336,7 +334,6 @@ impl InReplyTo {
|
||||
/// The event this relation belongs to replaces another event.
|
||||
#[derive(Clone, Debug)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct Replacement {
|
||||
/// The ID of the event being replacing.
|
||||
@ -446,7 +443,6 @@ impl EmoteMessageEventContent {
|
||||
/// Returns an html emote message if some markdown formatting was detected, otherwise returns a
|
||||
/// plain-text emote.
|
||||
#[cfg(feature = "markdown")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "markdown")))]
|
||||
pub fn markdown(body: impl AsRef<str> + Into<String>) -> Self {
|
||||
Self { formatted: FormattedBody::markdown(&body), ..Self::plain(body) }
|
||||
}
|
||||
@ -652,7 +648,6 @@ impl NoticeMessageEventContent {
|
||||
/// Returns an html notice if some markdown formatting was detected, otherwise returns a plain
|
||||
/// text notice.
|
||||
#[cfg(feature = "markdown")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "markdown")))]
|
||||
pub fn markdown(body: impl AsRef<str> + Into<String>) -> Self {
|
||||
Self { formatted: FormattedBody::markdown(&body), ..Self::plain(body) }
|
||||
}
|
||||
@ -781,7 +776,6 @@ impl FormattedBody {
|
||||
///
|
||||
/// Returns `None` if no markdown formatting was found.
|
||||
#[cfg(feature = "markdown")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "markdown")))]
|
||||
pub fn markdown(body: impl AsRef<str>) -> Option<Self> {
|
||||
let body = body.as_ref();
|
||||
let mut html_body = String::new();
|
||||
@ -821,7 +815,6 @@ impl TextMessageEventContent {
|
||||
/// Returns an html message if some markdown formatting was detected, otherwise returns a plain
|
||||
/// text message.
|
||||
#[cfg(feature = "markdown")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "markdown")))]
|
||||
pub fn markdown(body: impl AsRef<str> + Into<String>) -> Self {
|
||||
Self { formatted: FormattedBody::markdown(&body), ..Self::plain(body) }
|
||||
}
|
||||
@ -912,7 +905,6 @@ pub struct VideoInfo {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(rename = "xyz.amorgan.blurhash")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub blurhash: Option<String>,
|
||||
@ -928,7 +920,6 @@ impl VideoInfo {
|
||||
/// The payload for a key verification request message.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[serde(tag = "msgtype", rename = "m.key.verification.request")]
|
||||
pub struct KeyVerificationRequestEventContent {
|
||||
|
@ -24,7 +24,6 @@ pub struct Unsigned {
|
||||
|
||||
/// Server-compiled information from other events relating to this event.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(rename = "m.relations", skip_serializing_if = "Option::is_none")]
|
||||
pub relations: Option<Relations>,
|
||||
}
|
||||
@ -86,7 +85,6 @@ pub struct UnsignedWithPrevContent {
|
||||
transaction_id: Option<String>,
|
||||
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(rename = "m.relations", skip_serializing_if = "Option::is_none")]
|
||||
relations: Option<Relations>,
|
||||
|
||||
|
@ -31,13 +31,11 @@ ruma_api! {
|
||||
|
||||
/// Information on the master cross-signing keys of the queried users.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||
pub master_keys: BTreeMap<UserId, CrossSigningKey>,
|
||||
|
||||
/// Information on the self-signing keys of the queried users.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||
pub self_signing_keys: BTreeMap<UserId, CrossSigningKey>,
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ pub mod discovery;
|
||||
pub mod event;
|
||||
pub mod keys;
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
pub mod knock;
|
||||
pub mod membership;
|
||||
pub mod openid;
|
||||
|
@ -11,7 +11,6 @@ use serde_json::value::RawValue as RawJsonValue;
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct RoomState {
|
||||
#[cfg(not(feature = "unstable-pre-spec"))]
|
||||
#[cfg_attr(docsrs, doc(cfg(not(feature = "unstable-pre-spec"))))]
|
||||
/// The resident server's DNS name.
|
||||
pub origin: String,
|
||||
|
||||
|
@ -47,7 +47,6 @@ ruma_api! {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-doc/pull/2448).
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
#[serde(rename = "xyz.amorgan.blurhash")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub blurhash: Option<String>,
|
||||
|
@ -12,7 +12,6 @@ opaque_identifier! {
|
||||
impl DeviceId {
|
||||
/// Generates a random `DeviceId`, suitable for assignment to a new device.
|
||||
#[cfg(feature = "rand")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
|
||||
pub fn new() -> Box<Self> {
|
||||
Self::from_owned(generate_localpart(8))
|
||||
}
|
||||
|
@ -57,7 +57,6 @@ impl EventId {
|
||||
/// Does not currently ever fail, but may fail in the future if the homeserver cannot be parsed
|
||||
/// parsed as a valid host.
|
||||
#[cfg(feature = "rand")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
|
||||
pub fn new(server_name: &ServerName) -> Self {
|
||||
use crate::generate_localpart;
|
||||
|
||||
|
@ -35,7 +35,6 @@ impl RoomId {
|
||||
///
|
||||
/// Fails if the given homeserver cannot be parsed as a valid host.
|
||||
#[cfg(feature = "rand")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
|
||||
pub fn new(server_name: &ServerName) -> Self {
|
||||
use crate::generate_localpart;
|
||||
|
||||
|
@ -63,7 +63,6 @@ impl RoomIdOrAliasId {
|
||||
|
||||
/// Turn this `RoomIdOrAliasId` into `Either<RoomId, RoomAliasId>`
|
||||
#[cfg(feature = "either")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "either")))]
|
||||
pub fn into_either(self) -> either::Either<RoomId, RoomAliasId> {
|
||||
match self.variant() {
|
||||
Variant::RoomId => {
|
||||
|
@ -44,17 +44,14 @@ pub enum RoomVersionId {
|
||||
|
||||
/// A version 7 room.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
Version7,
|
||||
|
||||
/// A version 8 room.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
Version8,
|
||||
|
||||
/// A version 9 room.
|
||||
#[cfg(feature = "unstable-pre-spec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-pre-spec")))]
|
||||
Version9,
|
||||
|
||||
#[doc(hidden)]
|
||||
|
@ -40,7 +40,6 @@ impl UserId {
|
||||
/// Attempts to generate a `UserId` for the given origin server with a localpart consisting of
|
||||
/// 12 random ASCII characters.
|
||||
#[cfg(feature = "rand")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
|
||||
pub fn new(server_name: &ServerName) -> Self {
|
||||
use crate::generate_localpart;
|
||||
|
||||
|
@ -92,19 +92,15 @@ pub use ruma_identifiers::{
|
||||
};
|
||||
|
||||
#[cfg(feature = "client")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
|
||||
#[doc(inline)]
|
||||
pub use ruma_client as client;
|
||||
#[cfg(feature = "events")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "events")))]
|
||||
#[doc(inline)]
|
||||
pub use ruma_events as events;
|
||||
#[cfg(feature = "signatures")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "signatures")))]
|
||||
#[doc(inline)]
|
||||
pub use ruma_signatures as signatures;
|
||||
#[cfg(feature = "state-res")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "state-res")))]
|
||||
#[doc(inline)]
|
||||
pub use ruma_state_res as state_res;
|
||||
|
||||
@ -113,7 +109,6 @@ pub use ruma_state_res as state_res;
|
||||
///
|
||||
/// [apis]: https://matrix.org/docs/spec/#matrix-apis
|
||||
#[cfg(feature = "api")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "api")))]
|
||||
pub mod api {
|
||||
pub use ruma_api::*;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user