Skip to content

Commit 18680ce

Browse files
committed
doc: Call out feature gated functions/modules/etc in docs
Like in https://docs.rs/tokio/0.2.6/tokio/index.html#modules
1 parent 68af256 commit 18680ce

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ impl Client {
6666
///
6767
/// This requires the `tokio-executor` feature as it uses the default tokio executor.
6868
#[cfg(feature = "tokio-rt-core")]
69+
#[cfg_attr(docsrs, doc(cfg(feature = "tokio-rt-core")))]
6970
pub async fn get_multiplexed_tokio_connection(
7071
&self,
7172
) -> RedisResult<crate::aio::MultiplexedConnection> {

src/commands.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@ implement_commands! {
862862
/// }
863863
/// ```
864864
#[cfg(feature = "geospatial")]
865+
#[cfg_attr(docsrs, doc(cfg(feature = "geospatial")))]
865866
fn geo_add<K: ToRedisArgs, M: ToRedisArgs>(key: K, members: M) {
866867
cmd("GEOADD").arg(key).arg(members)
867868
}
@@ -898,6 +899,7 @@ implement_commands! {
898899
/// }
899900
/// ```
900901
#[cfg(feature = "geospatial")]
902+
#[cfg_attr(docsrs, doc(cfg(feature = "geospatial")))]
901903
fn geo_dist<K: ToRedisArgs, M1: ToRedisArgs, M2: ToRedisArgs>(
902904
key: K,
903905
member1: M1,
@@ -931,6 +933,7 @@ implement_commands! {
931933
/// }
932934
/// ```
933935
#[cfg(feature = "geospatial")]
936+
#[cfg_attr(docsrs, doc(cfg(feature = "geospatial")))]
934937
fn geo_hash<K: ToRedisArgs, M: ToRedisArgs>(key: K, members: M) {
935938
cmd("GEOHASH").arg(key).arg(members)
936939
}
@@ -959,6 +962,7 @@ implement_commands! {
959962
/// }
960963
/// ```
961964
#[cfg(feature = "geospatial")]
965+
#[cfg_attr(docsrs, doc(cfg(feature = "geospatial")))]
962966
fn geo_pos<K: ToRedisArgs, M: ToRedisArgs>(key: K, members: M) {
963967
cmd("GEOPOS").arg(key).arg(members)
964968
}
@@ -983,6 +987,7 @@ implement_commands! {
983987
/// }
984988
/// ```
985989
#[cfg(feature = "geospatial")]
990+
#[cfg_attr(docsrs, doc(cfg(feature = "geospatial")))]
986991
fn geo_radius<K: ToRedisArgs>(
987992
key: K,
988993
longitude: f64,
@@ -1003,6 +1008,7 @@ implement_commands! {
10031008
/// Retrieve members selected by distance with the center of `member`. The
10041009
/// member itself is always contained in the results.
10051010
#[cfg(feature = "geospatial")]
1011+
#[cfg_attr(docsrs, doc(cfg(feature = "geospatial")))]
10061012
fn geo_radius_by_member<K: ToRedisArgs, M: ToRedisArgs>(
10071013
key: K,
10081014
member: M,

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ mod macros;
373373
pub mod aio;
374374

375375
#[cfg(feature = "geospatial")]
376+
#[cfg_attr(docsrs, doc(cfg(feature = "geospatial")))]
376377
pub mod geo;
377378

378379
mod client;

0 commit comments

Comments
 (0)