Clean up cargo features
This commit is contained in:
parent
c692fe5565
commit
891db9083b
@ -22,4 +22,3 @@ serde_json = "1.0.61"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
unstable-exhaustive-types = []
|
unstable-exhaustive-types = []
|
||||||
unstable-synapse-quirks = ["ruma-events/unstable-synapse-quirks"]
|
|
||||||
|
@ -35,8 +35,4 @@ matches = "0.1.8"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
unstable-exhaustive-types = []
|
unstable-exhaustive-types = []
|
||||||
unstable-pre-spec = ["ruma-common/unstable-pre-spec"]
|
unstable-pre-spec = []
|
||||||
unstable-synapse-quirks = [
|
|
||||||
"ruma-common/unstable-synapse-quirks",
|
|
||||||
"ruma-events/unstable-synapse-quirks",
|
|
||||||
]
|
|
||||||
|
@ -54,8 +54,6 @@ tls-rustls-webpki-roots = [
|
|||||||
"_tls-rustls",
|
"_tls-rustls",
|
||||||
]
|
]
|
||||||
|
|
||||||
unstable-synapse-quirks = ["ruma-events/unstable-synapse-quirks"]
|
|
||||||
|
|
||||||
# Internal, not meant to be used directly
|
# Internal, not meant to be used directly
|
||||||
_tls = []
|
_tls = []
|
||||||
_tls-rustls = ["_tls"]
|
_tls-rustls = ["_tls"]
|
||||||
|
@ -22,6 +22,6 @@ serde_json = { version = "1.0.60", features = ["raw_value"] }
|
|||||||
matches = "0.1.8"
|
matches = "0.1.8"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
compat = []
|
||||||
unstable-exhaustive-types = []
|
unstable-exhaustive-types = []
|
||||||
unstable-synapse-quirks = []
|
|
||||||
unstable-pre-spec = []
|
unstable-pre-spec = []
|
||||||
|
@ -24,9 +24,9 @@ pub struct Protocol {
|
|||||||
|
|
||||||
/// A content URI representing an icon for the third party protocol.
|
/// A content URI representing an icon for the third party protocol.
|
||||||
///
|
///
|
||||||
/// If you activate the `unstable-synapse-quirks` feature, this field being absent in JSON will
|
/// If you activate the `compat` feature, this field being absent in JSON will give you an
|
||||||
/// give you an empty string here.
|
/// empty string here.
|
||||||
#[cfg_attr(feature = "unstable-synapse-quirks", serde(default))]
|
#[cfg_attr(feature = "compat", serde(default))]
|
||||||
pub icon: String,
|
pub icon: String,
|
||||||
|
|
||||||
/// The type definitions for the fields defined in `user_fields` and `location_fields`.
|
/// The type definitions for the fields defined in `user_fields` and `location_fields`.
|
||||||
|
@ -29,11 +29,12 @@ ruma-identifiers = { version = "=0.18.0-alpha.1", path = "../ruma-identifiers",
|
|||||||
trybuild = "1.0.38"
|
trybuild = "1.0.38"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
unstable-exhaustive-types = []
|
compat = []
|
||||||
unstable-pre-spec = ["ruma-common/unstable-pre-spec"]
|
|
||||||
unstable-synapse-quirks = []
|
|
||||||
markdown = ["pulldown-cmark"]
|
markdown = ["pulldown-cmark"]
|
||||||
|
|
||||||
|
unstable-exhaustive-types = []
|
||||||
|
unstable-pre-spec = []
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "event_deserialize"
|
name = "event_deserialize"
|
||||||
harness = false
|
harness = false
|
||||||
|
@ -17,10 +17,7 @@ pub type PowerLevelsEvent = StateEvent<PowerLevelsEventContent>;
|
|||||||
#[ruma_event(type = "m.room.power_levels")]
|
#[ruma_event(type = "m.room.power_levels")]
|
||||||
pub struct PowerLevelsEventContent {
|
pub struct PowerLevelsEventContent {
|
||||||
/// The level required to ban a user.
|
/// The level required to ban a user.
|
||||||
#[cfg_attr(
|
#[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))]
|
||||||
feature = "unstable-synapse-quirks",
|
|
||||||
serde(deserialize_with = "ruma_serde::int_or_string_to_int")
|
|
||||||
)]
|
|
||||||
#[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")]
|
#[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")]
|
||||||
#[ruma_event(skip_redaction)]
|
#[ruma_event(skip_redaction)]
|
||||||
pub ban: Int,
|
pub ban: Int,
|
||||||
@ -29,7 +26,7 @@ pub struct PowerLevelsEventContent {
|
|||||||
///
|
///
|
||||||
/// This is a mapping from event type to power level required.
|
/// This is a mapping from event type to power level required.
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "unstable-synapse-quirks",
|
feature = "compat",
|
||||||
serde(deserialize_with = "ruma_serde::btreemap_int_or_string_to_int_values")
|
serde(deserialize_with = "ruma_serde::btreemap_int_or_string_to_int_values")
|
||||||
)]
|
)]
|
||||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||||
@ -37,45 +34,30 @@ pub struct PowerLevelsEventContent {
|
|||||||
pub events: BTreeMap<EventType, Int>,
|
pub events: BTreeMap<EventType, Int>,
|
||||||
|
|
||||||
/// The default level required to send message events.
|
/// The default level required to send message events.
|
||||||
#[cfg_attr(
|
#[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))]
|
||||||
feature = "unstable-synapse-quirks",
|
|
||||||
serde(deserialize_with = "ruma_serde::int_or_string_to_int")
|
|
||||||
)]
|
|
||||||
#[serde(default, skip_serializing_if = "ruma_serde::is_default")]
|
#[serde(default, skip_serializing_if = "ruma_serde::is_default")]
|
||||||
#[ruma_event(skip_redaction)]
|
#[ruma_event(skip_redaction)]
|
||||||
pub events_default: Int,
|
pub events_default: Int,
|
||||||
|
|
||||||
/// The level required to invite a user.
|
/// The level required to invite a user.
|
||||||
#[cfg_attr(
|
#[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))]
|
||||||
feature = "unstable-synapse-quirks",
|
|
||||||
serde(deserialize_with = "ruma_serde::int_or_string_to_int")
|
|
||||||
)]
|
|
||||||
#[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")]
|
#[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")]
|
||||||
pub invite: Int,
|
pub invite: Int,
|
||||||
|
|
||||||
/// The level required to kick a user.
|
/// The level required to kick a user.
|
||||||
#[cfg_attr(
|
#[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))]
|
||||||
feature = "unstable-synapse-quirks",
|
|
||||||
serde(deserialize_with = "ruma_serde::int_or_string_to_int")
|
|
||||||
)]
|
|
||||||
#[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")]
|
#[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")]
|
||||||
#[ruma_event(skip_redaction)]
|
#[ruma_event(skip_redaction)]
|
||||||
pub kick: Int,
|
pub kick: Int,
|
||||||
|
|
||||||
/// The level required to redact an event.
|
/// The level required to redact an event.
|
||||||
#[cfg_attr(
|
#[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))]
|
||||||
feature = "unstable-synapse-quirks",
|
|
||||||
serde(deserialize_with = "ruma_serde::int_or_string_to_int")
|
|
||||||
)]
|
|
||||||
#[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")]
|
#[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")]
|
||||||
#[ruma_event(skip_redaction)]
|
#[ruma_event(skip_redaction)]
|
||||||
pub redact: Int,
|
pub redact: Int,
|
||||||
|
|
||||||
/// The default level required to send state events.
|
/// The default level required to send state events.
|
||||||
#[cfg_attr(
|
#[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))]
|
||||||
feature = "unstable-synapse-quirks",
|
|
||||||
serde(deserialize_with = "ruma_serde::int_or_string_to_int")
|
|
||||||
)]
|
|
||||||
#[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")]
|
#[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")]
|
||||||
#[ruma_event(skip_redaction)]
|
#[ruma_event(skip_redaction)]
|
||||||
pub state_default: Int,
|
pub state_default: Int,
|
||||||
@ -84,7 +66,7 @@ pub struct PowerLevelsEventContent {
|
|||||||
///
|
///
|
||||||
/// This is a mapping from `user_id` to power level for that user.
|
/// This is a mapping from `user_id` to power level for that user.
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "unstable-synapse-quirks",
|
feature = "compat",
|
||||||
serde(deserialize_with = "ruma_serde::btreemap_int_or_string_to_int_values")
|
serde(deserialize_with = "ruma_serde::btreemap_int_or_string_to_int_values")
|
||||||
)]
|
)]
|
||||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||||
@ -92,10 +74,7 @@ pub struct PowerLevelsEventContent {
|
|||||||
pub users: BTreeMap<UserId, Int>,
|
pub users: BTreeMap<UserId, Int>,
|
||||||
|
|
||||||
/// The default power level for every user in the room.
|
/// The default power level for every user in the room.
|
||||||
#[cfg_attr(
|
#[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))]
|
||||||
feature = "unstable-synapse-quirks",
|
|
||||||
serde(deserialize_with = "ruma_serde::int_or_string_to_int")
|
|
||||||
)]
|
|
||||||
#[serde(default, skip_serializing_if = "ruma_serde::is_default")]
|
#[serde(default, skip_serializing_if = "ruma_serde::is_default")]
|
||||||
#[ruma_event(skip_redaction)]
|
#[ruma_event(skip_redaction)]
|
||||||
pub users_default: Int,
|
pub users_default: Int,
|
||||||
@ -130,10 +109,7 @@ impl Default for PowerLevelsEventContent {
|
|||||||
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
|
||||||
pub struct NotificationPowerLevels {
|
pub struct NotificationPowerLevels {
|
||||||
/// The level required to trigger an `@room` notification.
|
/// The level required to trigger an `@room` notification.
|
||||||
#[cfg_attr(
|
#[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))]
|
||||||
feature = "unstable-synapse-quirks",
|
|
||||||
serde(deserialize_with = "ruma_serde::int_or_string_to_int")
|
|
||||||
)]
|
|
||||||
#[serde(default = "default_power_level")]
|
#[serde(default = "default_power_level")]
|
||||||
pub room: Int,
|
pub room: Int,
|
||||||
}
|
}
|
||||||
|
@ -17,15 +17,15 @@ pub type ThirdPartyInviteEvent = StateEvent<ThirdPartyInviteEventContent>;
|
|||||||
#[ruma_event(type = "m.room.third_party_invite")]
|
#[ruma_event(type = "m.room.third_party_invite")]
|
||||||
pub struct ThirdPartyInviteEventContent {
|
pub struct ThirdPartyInviteEventContent {
|
||||||
/// A user-readable string which represents the user who has been invited.
|
/// A user-readable string which represents the user who has been invited.
|
||||||
#[cfg_attr(feature = "unstable-synapse-quirks", serde(default))]
|
#[cfg_attr(feature = "compat", serde(default))]
|
||||||
pub display_name: String,
|
pub display_name: String,
|
||||||
|
|
||||||
/// A URL which can be fetched to validate whether the key has been revoked.
|
/// A URL which can be fetched to validate whether the key has been revoked.
|
||||||
#[cfg_attr(feature = "unstable-synapse-quirks", serde(default))]
|
#[cfg_attr(feature = "compat", serde(default))]
|
||||||
pub key_validity_url: String,
|
pub key_validity_url: String,
|
||||||
|
|
||||||
/// A Base64-encoded Ed25519 key with which the token must be signed.
|
/// A Base64-encoded Ed25519 key with which the token must be signed.
|
||||||
#[cfg_attr(feature = "unstable-synapse-quirks", serde(default))]
|
#[cfg_attr(feature = "compat", serde(default))]
|
||||||
pub public_key: String,
|
pub public_key: String,
|
||||||
|
|
||||||
/// Keys with which the token may be signed.
|
/// Keys with which the token may be signed.
|
||||||
|
@ -15,7 +15,7 @@ pub type TombstoneEvent = StateEvent<TombstoneEventContent>;
|
|||||||
#[ruma_event(type = "m.room.tombstone")]
|
#[ruma_event(type = "m.room.tombstone")]
|
||||||
pub struct TombstoneEventContent {
|
pub struct TombstoneEventContent {
|
||||||
/// A server-defined message.
|
/// A server-defined message.
|
||||||
#[cfg_attr(feature = "unstable-synapse-quirks", serde(default))]
|
#[cfg_attr(feature = "compat", serde(default))]
|
||||||
pub body: String,
|
pub body: String,
|
||||||
|
|
||||||
/// The new room the client should be visiting.
|
/// The new room the client should be visiting.
|
||||||
|
@ -29,5 +29,4 @@ matches = "0.1.8"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
unstable-exhaustive-types = []
|
unstable-exhaustive-types = []
|
||||||
unstable-pre-spec = ["ruma-common/unstable-pre-spec"]
|
unstable-pre-spec = []
|
||||||
unstable-synapse-quirks = ["ruma-events/unstable-synapse-quirks"]
|
|
||||||
|
@ -22,4 +22,3 @@ serde_json = "1.0.61"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
unstable-exhaustive-types = []
|
unstable-exhaustive-types = []
|
||||||
unstable-synapse-quirks = ["ruma-events/unstable-synapse-quirks"]
|
|
||||||
|
@ -33,9 +33,6 @@ ruma-push-gateway-api = { version = "0.0.1", path = "../ruma-push-gateway-api",
|
|||||||
serde = { version = "1.0.118", features = ["derive"] }
|
serde = { version = "1.0.118", features = ["derive"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
either = ["ruma-identifiers/either"]
|
|
||||||
rand = ["ruma-identifiers/rand"]
|
|
||||||
|
|
||||||
api = ["ruma-api"]
|
api = ["ruma-api"]
|
||||||
events = ["ruma-events"]
|
events = ["ruma-events"]
|
||||||
signatures = ["ruma-signatures"]
|
signatures = ["ruma-signatures"]
|
||||||
@ -46,22 +43,34 @@ federation-api = ["api", "signatures", "ruma-federation-api"]
|
|||||||
identity-service-api = ["api", "ruma-identity-service-api"]
|
identity-service-api = ["api", "ruma-identity-service-api"]
|
||||||
push-gateway-api = ["api", "ruma-push-gateway-api"]
|
push-gateway-api = ["api", "ruma-push-gateway-api"]
|
||||||
|
|
||||||
|
# Concenience features
|
||||||
|
either = ["ruma-identifiers/either"]
|
||||||
|
rand = ["ruma-identifiers/rand"]
|
||||||
|
markdown = ["ruma-events/markdown"]
|
||||||
|
|
||||||
|
# Increase compatibility with other parts of the Matrix ecosystem, at the
|
||||||
|
# expense of weird behaviour where things deviate from the specification.
|
||||||
|
#
|
||||||
|
# For example, some mandatory string fields are defaulted to an empty string if
|
||||||
|
# missing with this feature.
|
||||||
|
compat = ["ruma-common/compat", "ruma-events/compat"]
|
||||||
|
|
||||||
|
# unstable: by using any of these, you opt out of all semver guarantees Ruma
|
||||||
|
# otherwise provides!
|
||||||
unstable-exhaustive-types = [
|
unstable-exhaustive-types = [
|
||||||
|
"ruma-common/unstable-exhaustive-types",
|
||||||
"ruma-events/unstable-exhaustive-types",
|
"ruma-events/unstable-exhaustive-types",
|
||||||
"ruma-appservice-api/unstable-exhaustive-types",
|
"ruma-appservice-api/unstable-exhaustive-types",
|
||||||
"ruma-client-api/unstable-exhaustive-types",
|
"ruma-client-api/unstable-exhaustive-types",
|
||||||
"ruma-federation-api/unstable-exhaustive-types",
|
"ruma-federation-api/unstable-exhaustive-types",
|
||||||
"ruma-common/unstable-exhaustive-types",
|
"ruma-identity-service-api/unstable-exhaustive-types",
|
||||||
|
"ruma-push-gateway-api/unstable-exhaustive-types",
|
||||||
]
|
]
|
||||||
unstable-pre-spec = [
|
unstable-pre-spec = [
|
||||||
|
"ruma-common/unstable-pre-spec",
|
||||||
"ruma-client-api/unstable-pre-spec",
|
"ruma-client-api/unstable-pre-spec",
|
||||||
"ruma-events/unstable-pre-spec",
|
"ruma-events/unstable-pre-spec",
|
||||||
"ruma-federation-api/unstable-pre-spec",
|
"ruma-federation-api/unstable-pre-spec",
|
||||||
"ruma-common/unstable-pre-spec",
|
#"ruma-identity-service-api/unstable-pre-spec",
|
||||||
|
#"ruma-push-gateway-api/unstable-pre-spec",
|
||||||
]
|
]
|
||||||
unstable-synapse-quirks = [
|
|
||||||
"ruma-client-api/unstable-synapse-quirks",
|
|
||||||
"ruma-common/unstable-synapse-quirks",
|
|
||||||
"ruma-events/unstable-synapse-quirks",
|
|
||||||
]
|
|
||||||
markdown = ["ruma-events/markdown"]
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user