Skip to content

Commit 4d9f0a1

Browse files
committed
Improve features module documentation
1 parent 2b5db73 commit 4d9f0a1

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

lightning/src/ln/features.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
//! Lightning exposes sets of supported operations through "feature flags". This module includes
2-
//! types to store those feature flags and query for specific flags.
1+
//! Feature flag definitions for the Lightning protocol according to [BOLT #9].
2+
//!
3+
//! Lightning nodes advertise a supported set of operation through feature flags. Features are
4+
//! applicable for a specific context as indicated in some [messages]. [`Features`] encapsulates
5+
//! behavior for specifying and checking feature flags for a particular context. Each feature is
6+
//! defined internally by a trait specifying the corresponding flags (i.e., even and odd bits). A
7+
//! [`Context`] is used to parameterize [`Features`] and defines which features it can support.
8+
//!
9+
//! [BOLT #9]: https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md
10+
//! [messages]: ../msgs/index.html
11+
//! [`Features`]: struct.Features.html
12+
//! [`Context`]: sealed/trait.Context.html
313
414
use std::{cmp, fmt};
515
use std::result::Result;
@@ -155,11 +165,11 @@ impl<T: sealed::Context> fmt::Debug for Features<T> {
155165
}
156166
}
157167

158-
/// A feature message as it appears in an init message
168+
/// Features used within an `init` message.
159169
pub type InitFeatures = Features<sealed::InitContext>;
160-
/// A feature message as it appears in a node_announcement message
170+
/// Features used within a `node_announcement` message.
161171
pub type NodeFeatures = Features<sealed::NodeContext>;
162-
/// A feature message as it appears in a channel_announcement message
172+
/// Features used within a `channel_announcement` message.
163173
pub type ChannelFeatures = Features<sealed::ChannelContext>;
164174

165175
impl InitFeatures {

0 commit comments

Comments
 (0)