Cargo Features

[dependencies]
ruma-common = { version = "0.12.1", default-features = false, features = ["server", "api", "canonical-json", "js", "rand", "unstable-msc2870", "unstable-msc3930", "unstable-msc3931", "unstable-msc3932", "unstable-msc3958", "unstable-unspecified", "compat-arbitrary-length-ids", "compat-key-id", "compat-user-id", "compat-empty-string-null", "compat-null", "compat-optional", "getrandom"] }
default = client, server

These feature gates exist only for the tests. Disabling them results in a compile error.

client server default
api

Enables http ^0.2.8 and konst

Affects ruma-common::api

canonical-json

Affects value::CanonicalJsonObject, value::CanonicalJsonValue, canonical_json::CanonicalJsonError, canonical_json::RedactionError, ruma-common::canonical_json

js

Enables js-sys, js of optional uuid and js of optional getrandom

getrandom:

Feature to enable JavaScript bindings on wasm*-unknown-unknown

rand

Enables rand and uuid

unstable-exhaustive-types unstable-msc2870
unstable-msc3930
unstable-msc3931 unstable-msc3932?

Affects condition::RoomVersionFeature, condition::PushConditionRoomCtx.supported_features

unstable-msc3932 = unstable-msc3931
unstable-msc3958
unstable-unspecified

Affects push::HttpPusherData.default_payload, thirdparty::ProtocolInstance.instance_id, thirdparty::ProtocolInstanceInit.instance_id

compat-arbitrary-length-ids

Allow IDs to exceed 255 bytes.

Enables compat-arbitrary-length-ids of ruma-identifiers-validation

compat-key-id

Don't validate the version part in KeyId.

Enables compat-key-id of ruma-identifiers-validation

compat-user-id

Allow some user IDs that are invalid even with the specified historical user ID scheme.

Enables compat-user-id of ruma-identifiers-validation

compat-empty-string-null

Allow some mandatory fields to be missing, defaulting them to an empty string in deserialization.

compat-null

Allow certain fields to be null for compatibility, treating that the same as the field being absent.

compat-optional

Allow certain fields to be absent even though the spec marks them as mandatory. Deserialization will yield a default value like an empty string.

Features from optional dependencies

getrandom implicit feature

Enables getrandom

getrandom:

A small cross-platform library for retrieving random data from system source