Skip to content
This repository was archived by the owner on Sep 1, 2023. It is now read-only.

Commit 8a4df4e

Browse files
Merge pull request #86 from ava-labs/docsrs
Add docsrs annotations
2 parents fec8159 + 08dc947 commit 8a4df4e

File tree

8 files changed

+23
-1
lines changed

8 files changed

+23
-1
lines changed

src/codec/serde/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ pub mod ip_port;
88
pub mod rfc_3339;
99

1010
#[cfg(feature = "codec_base64")]
11+
#[cfg_attr(docsrs, doc(cfg(feature = "codec_base64")))]
1112
pub mod base64_bytes;
1213

1314
#[cfg(feature = "codec_big_int")]
15+
#[cfg_attr(docsrs, doc(cfg(feature = "codec_big_int")))]
1416
pub mod hex_0x_big_int;

src/jsonrpc/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub mod info;
77
pub mod platformvm;
88

99
#[cfg(feature = "jsonrpc_client")]
10+
#[cfg_attr(docsrs, doc(cfg(feature = "jsonrpc_client")))]
1011
pub mod client;
1112

1213
use std::{

src/key/secp256k1/kms/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#[cfg(feature = "kms_aws")]
2+
#[cfg_attr(docsrs, doc(cfg(feature = "kms_aws")))]
23
pub mod aws;

src/key/secp256k1/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ pub mod signature;
77
pub mod txs;
88

99
#[cfg(feature = "libsecp256k1")]
10+
#[cfg_attr(docsrs, doc(cfg(feature = "libsecp256k1")))]
1011
pub mod libsecp256k1;
1112

1213
#[cfg(feature = "mnemonic")]
14+
#[cfg_attr(docsrs, doc(cfg(feature = "mnemonic")))]
1315
pub mod mnemonic;
1416

1517
use std::{

src/key/secp256k1/private_key.rs

+1
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ impl Key {
237237

238238
/// Derives the private key that uses libsecp256k1.
239239
#[cfg(feature = "libsecp256k1")]
240+
#[cfg_attr(docsrs, doc(cfg(feature = "libsecp256k1")))]
240241
pub fn to_libsecp256k1(&self) -> Result<crate::key::secp256k1::libsecp256k1::PrivateKey> {
241242
let b = self.to_bytes();
242243
crate::key::secp256k1::libsecp256k1::PrivateKey::from_bytes(&b)

src/lib.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg_attr(docsrs, feature(doc_cfg))]
2+
13
pub mod avm;
24
pub mod choices;
35
pub mod codec;
@@ -17,28 +19,37 @@ pub mod utils;
1719
pub mod verify;
1820

1921
#[cfg(feature = "avalanchego")]
22+
#[cfg_attr(docsrs, doc(cfg(feature = "avalanchego")))]
2023
pub mod avalanchego;
2124

2225
#[cfg(feature = "avalanchego")]
26+
#[cfg_attr(docsrs, doc(cfg(feature = "avalanchego")))]
2327
pub mod coreth;
2428

2529
#[cfg(feature = "subnet_evm")]
30+
#[cfg_attr(docsrs, doc(cfg(feature = "subnet_evm")))]
2631
pub mod subnet_evm;
2732

2833
#[cfg(feature = "xsvm")]
34+
#[cfg_attr(docsrs, doc(cfg(feature = "xsvm")))]
2935
pub mod xsvm;
3036

3137
#[cfg(feature = "evm")]
38+
#[cfg_attr(docsrs, doc(cfg(feature = "evm")))]
3239
pub mod evm;
3340

3441
#[cfg(feature = "message")]
42+
#[cfg_attr(docsrs, doc(cfg(feature = "message")))]
3543
pub mod message;
3644

3745
#[cfg(feature = "wallet")]
46+
#[cfg_attr(docsrs, doc(cfg(feature = "wallet")))]
3847
pub mod wallet;
3948

4049
#[cfg(feature = "proto")]
50+
#[cfg_attr(docsrs, doc(cfg(feature = "proto")))]
4151
pub mod proto;
4252

43-
#[cfg(any(doc, feature = "subnet"))]
53+
#[cfg(feature = "subnet")]
54+
#[cfg_attr(docsrs, doc(cfg(feature = "subnet")))]
4455
pub mod subnet;

src/subnet/rpc/vm/server.rs

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub struct Server<V> {
4545
pub vm: Arc<RwLock<V>>,
4646

4747
#[cfg(feature = "subnet_metrics")]
48+
#[cfg_attr(docsrs, doc(cfg(feature = "subnet_metrics")))]
4849
/// Subnet Prometheus process metrics.
4950
pub process_metrics: Arc<RwLock<prometheus::Registry>>,
5051

@@ -57,6 +58,7 @@ impl<V: ChainVm> Server<V> {
5758
Self {
5859
vm: Arc::new(RwLock::new(vm)),
5960
#[cfg(feature = "subnet_metrics")]
61+
#[cfg_attr(docsrs, doc(cfg(feature = "subnet_metrics")))]
6062
process_metrics: Arc::new(RwLock::new(prometheus::default_registry().to_owned())),
6163
stop_ch,
6264
}
@@ -710,6 +712,7 @@ where
710712
}
711713

712714
#[cfg(feature = "subnet_metrics")]
715+
#[cfg_attr(docsrs, doc(cfg(feature = "subnet_metrics")))]
713716
async fn gather(
714717
&self,
715718
_req: Request<Empty>,

src/wallet/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ pub mod p;
22
pub mod x;
33

44
#[cfg(feature = "wallet_evm")]
5+
#[cfg_attr(docsrs, doc(cfg(feature = "wallet_evm")))]
56
pub mod evm;
67

78
use std::{

0 commit comments

Comments
 (0)