Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 97233da

Browse files
committed
Deny missing docs
1 parent 8da288a commit 97233da

File tree

14 files changed

+63
-33
lines changed

14 files changed

+63
-33
lines changed

bee-inx/examples/utxo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async fn main() -> Result<(), Error> {
1515
let mut unspent_outputs = inx.read_unspent_outputs().await?;
1616

1717
let mut count = 0;
18-
while let Some(_) = unspent_outputs.next().await {
18+
while let Some(_unspent_output) = unspent_outputs.next().await {
1919
count += 1;
2020
}
2121
println!("Read {count} unspent outputs.");

bee-inx/src/block/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright 2022 IOTA Stiftung
22
// SPDX-License-Identifier: Apache-2.0
33

4+
/// A module that provides block related INX responses.
45
pub mod responses;
56

67
use futures::stream::{Stream, StreamExt};
@@ -15,7 +16,7 @@ use crate::{
1516
};
1617

1718
impl Inx {
18-
// TODO
19+
/// Listens to all blocks.
1920
pub async fn listen_to_blocks(&mut self) -> Result<impl Stream<Item = Result<Block, Error>>, Error> {
2021
Ok(self
2122
.client
@@ -25,7 +26,7 @@ impl Inx {
2526
.map(try_from_inx_type))
2627
}
2728

28-
// TODO
29+
/// Listens to solid blocks.
2930
pub async fn listen_to_solid_blocks(&mut self) -> Result<impl Stream<Item = Result<BlockMetadata, Error>>, Error> {
3031
Ok(self
3132
.client
@@ -35,7 +36,7 @@ impl Inx {
3536
.map(try_from_inx_type))
3637
}
3738

38-
// TODO
39+
/// Listens to referenced blocks.
3940
pub async fn listen_to_referenced_blocks(
4041
&mut self,
4142
) -> Result<impl Stream<Item = Result<BlockMetadata, Error>>, Error> {
@@ -47,7 +48,7 @@ impl Inx {
4748
.map(try_from_inx_type))
4849
}
4950

50-
// TODO
51+
/// Requests the block with the given block id.
5152
pub async fn read_block(&mut self, block_id: bee::BlockId) -> Result<Raw<bee::Block>, Error> {
5253
Ok(self
5354
.client
@@ -58,7 +59,7 @@ impl Inx {
5859
.into())
5960
}
6061

61-
// TODO
62+
/// Requests the metadata of the block with the given block id.
6263
pub async fn read_block_metadata(&mut self, block_id: bee::BlockId) -> Result<BlockMetadata, Error> {
6364
Ok(self
6465
.client
@@ -68,7 +69,7 @@ impl Inx {
6869
.try_into()?)
6970
}
7071

71-
// TODO
72+
/// Submits a block and returns its corresponding block id.
7273
pub async fn submit_block(&mut self, raw_block: Raw<bee::Block>) -> Result<bee::BlockId, Error> {
7374
Ok(self
7475
.client

bee-inx/src/block/responses.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ impl From<LedgerInclusionState> for inx::LedgerInclusionState {
153153
}
154154
}
155155

156+
/// Whether a block contains a transaction that is either included or conflicting, or contains no transaction at all.
156157
#[allow(missing_docs)]
157158
#[derive(Clone, Debug, PartialEq, Eq)]
158159
pub enum LedgerInclusionState {

bee-inx/src/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use inx::tonic;
55
use thiserror::Error;
66

7+
#[allow(missing_docs)]
78
#[derive(Debug, Error)]
89
pub enum Error {
910
#[error(transparent)]

bee-inx/src/lib.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
// Copyright 2022 IOTA Stiftung
22
// SPDX-License-Identifier: Apache-2.0
33

4+
//! Bee compatible INX types and INX node request bindings.
5+
6+
#![deny(missing_docs)]
7+
48
mod error;
59

10+
/// A module that provides block related requests..
611
pub mod block;
12+
/// A module that provides the INX client.
713
pub mod client;
14+
/// A module that provides milestone related requests.
815
pub mod milestone;
16+
/// A module that provides node related requests.
917
pub mod node;
18+
/// A module that provides the [`Raw<T: Packable>`] struct.
1019
pub mod raw;
20+
/// A module that provides UTXO ledger related requests.
1121
pub mod utxo;
1222

1323
pub use self::{block::*, error::Error, milestone::*, node::*, raw::*, utxo::*};
1424

15-
pub mod inx {
25+
pub(crate) mod inx {
1626
pub use ::inx::proto::{
1727
block_metadata::*,
1828
ledger_update::{marker::*, *},
@@ -36,6 +46,7 @@ pub(crate) mod bee {
3646
pub use bee_block::{protocol::protocol_parameters, rand::output::rand_output};
3747
}
3848

49+
#[allow(missing_docs)]
3950
#[macro_export]
4051
macro_rules! return_err_if_none {
4152
($object:ident.$field:ident) => {

bee-inx/src/milestone/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Copyright 2022 IOTA Stiftung
22
// SPDX-License-Identifier: Apache-2.0
33

4+
/// A module that provides milestone related INX requests.
45
pub mod requests;
6+
/// A module that provides milestone related INX responses.
57
pub mod responses;
68

79
use futures::stream::{Stream, StreamExt};
@@ -15,7 +17,7 @@ use crate::{
1517
};
1618

1719
impl Inx {
18-
/// TODO
20+
/// Requests a particular milestone.
1921
pub async fn read_milestone(&mut self, request: MilestoneRequest) -> Result<Milestone, Error> {
2022
Ok(self
2123
.client
@@ -48,7 +50,7 @@ impl Inx {
4850
.map(try_from_inx_type))
4951
}
5052

51-
/// TODO
53+
/// Requests "white flag" data for a milestone.
5254
pub async fn compute_white_flag(&mut self, request: WhiteFlagRequest) -> Result<WhiteFlagResponse, Error> {
5355
Ok(self
5456
.client
@@ -71,7 +73,7 @@ impl Inx {
7173
.map(try_from_inx_type))
7274
}
7375

74-
/// TODO
76+
/// Reads the past cone metadata of a milestone specified by a [`MilestoneRequest`].
7577
pub async fn read_milestone_cone_metadata(
7678
&mut self,
7779
request: MilestoneRequest,

bee-inx/src/milestone/requests.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use std::ops::{Bound, RangeBounds};
55

66
use crate::{bee, error, inx};
77

8+
/// Allows to request a milestone by either its index or its id.
9+
#[allow(missing_docs)]
810
pub enum MilestoneRequest {
911
MilestoneIndex(bee::MilestoneIndex),
1012
MilestoneId(bee::MilestoneId),
@@ -71,6 +73,7 @@ where
7173
}
7274
}
7375

76+
/// Allows to request "white flag" data for a particular milestone.
7477
#[derive(Clone, Debug, PartialEq, Eq)]
7578
pub struct WhiteFlagRequest {
7679
milestone_index: bee::MilestoneIndex,

bee-inx/src/milestone/responses.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ impl From<Milestone> for inx::Milestone {
3636
}
3737

3838
/// The [`Milestone`] type.
39+
#[allow(missing_docs)]
3940
#[derive(Clone, Debug, PartialEq, Eq)]
4041
pub struct MilestoneAndProtocolParameters {
4142
pub milestone: Milestone,
@@ -95,6 +96,8 @@ impl From<MilestoneInfo> for inx::MilestoneInfo {
9596
}
9697
}
9798

99+
/// The response of a corresponding "white flag" request.
100+
#[allow(missing_docs)]
98101
#[derive(Clone, Debug, PartialEq, Eq)]
99102
pub struct WhiteFlagResponse {
100103
milestone_inclusion_merkle_root: Vec<u8>,

bee-inx/src/node/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Copyright 2022 IOTA Stiftung
22
// SPDX-License-Identifier: Apache-2.0
33

4+
/// A module that provides node related INX requests.
45
pub mod requests;
6+
/// A module that provides node related INX responses.
57
pub mod responses;
68

79
use futures::stream::{Stream, StreamExt};
@@ -15,13 +17,13 @@ use crate::{
1517
};
1618

1719
impl Inx {
18-
/// TODO
20+
/// Requests the status of the connected node.
1921
pub async fn read_node_status(&mut self) -> Result<NodeStatus, Error> {
2022
NodeStatus::try_from(self.client.read_node_status(inx::NoParams {}).await?.into_inner())
2123
.map_err(Error::InxError)
2224
}
2325

24-
// TODO
26+
/// Listens to node status updates.
2527
pub async fn listen_to_node_status(
2628
&mut self,
2729
request: NodeStatusRequest,
@@ -34,7 +36,7 @@ impl Inx {
3436
.map(try_from_inx_type))
3537
}
3638

37-
/// TODO
39+
/// Requests the configuration of the connected node.
3840
pub async fn read_node_configuration(&mut self) -> Result<NodeConfiguration, Error> {
3941
NodeConfiguration::try_from(
4042
self.client
@@ -45,7 +47,7 @@ impl Inx {
4547
.map_err(Error::InxError)
4648
}
4749

48-
/// TODO
50+
/// Requests the protocol parameters of the connected node.
4951
pub async fn read_protocol_parameters(&mut self, request: MilestoneRequest) -> Result<ProtocolParameters, Error> {
5052
Ok(self
5153
.client

bee-inx/src/node/requests.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
use crate::inx;
55

6-
/// TODO
6+
/// A request for the node status.
7+
#[allow(missing_docs)]
78
#[derive(Clone, Debug, PartialEq, Eq)]
89
pub struct NodeStatusRequest {
910
pub cooldown_in_milliseconds: u32,

0 commit comments

Comments
 (0)