Make docsrs show items for all features
with indicators what needs to be enabled to use each conditional item
This commit is contained in:
parent
ccaffcf107
commit
8f9bcd3a65
@ -12,6 +12,10 @@ repository = "https://github.com/ruma/ruma-identifiers"
|
|||||||
version = "0.14.1"
|
version = "0.14.1"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
features = ["all"]
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["serde"]
|
default = ["serde"]
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ pub type DeviceId = String;
|
|||||||
|
|
||||||
/// Generates a random `DeviceId`, suitable for assignment to a new device.
|
/// Generates a random `DeviceId`, suitable for assignment to a new device.
|
||||||
#[cfg(feature = "rand")]
|
#[cfg(feature = "rand")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
|
||||||
pub fn generate() -> DeviceId {
|
pub fn generate() -> DeviceId {
|
||||||
generate_localpart(8)
|
generate_localpart(8)
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ impl EventId {
|
|||||||
/// Does not currently ever fail, but may fail in the future if the homeserver cannot be parsed
|
/// Does not currently ever fail, but may fail in the future if the homeserver cannot be parsed
|
||||||
/// parsed as a valid host.
|
/// parsed as a valid host.
|
||||||
#[cfg(feature = "rand")]
|
#[cfg(feature = "rand")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
|
||||||
pub fn new(server_name: &str) -> Result<Self, Error> {
|
pub fn new(server_name: &str) -> Result<Self, Error> {
|
||||||
use crate::{generate_localpart, is_valid_server_name};
|
use crate::{generate_localpart, is_valid_server_name};
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
)]
|
)]
|
||||||
// Since we support Rust 1.36.0, we can't apply this suggestion yet
|
// Since we support Rust 1.36.0, we can't apply this suggestion yet
|
||||||
#![allow(clippy::use_self)]
|
#![allow(clippy::use_self)]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
||||||
#[cfg(feature = "diesel")]
|
#[cfg(feature = "diesel")]
|
||||||
#[cfg_attr(feature = "diesel", macro_use)]
|
#[cfg_attr(feature = "diesel", macro_use)]
|
||||||
@ -31,6 +32,7 @@ mod macros;
|
|||||||
|
|
||||||
pub mod device_id;
|
pub mod device_id;
|
||||||
#[cfg(feature = "diesel")]
|
#[cfg(feature = "diesel")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "diesel")))]
|
||||||
mod diesel_integration;
|
mod diesel_integration;
|
||||||
mod error;
|
mod error;
|
||||||
mod event_id;
|
mod event_id;
|
||||||
|
@ -34,6 +34,7 @@ impl RoomId {
|
|||||||
///
|
///
|
||||||
/// Fails if the given homeserver cannot be parsed as a valid host.
|
/// Fails if the given homeserver cannot be parsed as a valid host.
|
||||||
#[cfg(feature = "rand")]
|
#[cfg(feature = "rand")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
|
||||||
pub fn new(server_name: &str) -> Result<Self, Error> {
|
pub fn new(server_name: &str) -> Result<Self, Error> {
|
||||||
use crate::{generate_localpart, is_valid_server_name};
|
use crate::{generate_localpart, is_valid_server_name};
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ impl UserId {
|
|||||||
///
|
///
|
||||||
/// Fails if the given homeserver cannot be parsed as a valid host.
|
/// Fails if the given homeserver cannot be parsed as a valid host.
|
||||||
#[cfg(feature = "rand")]
|
#[cfg(feature = "rand")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
|
||||||
pub fn new(server_name: &str) -> Result<Self, Error> {
|
pub fn new(server_name: &str) -> Result<Self, Error> {
|
||||||
use crate::generate_localpart;
|
use crate::generate_localpart;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user