Skip to content

Commit 6d191e2

Browse files
authored
Specify how to create a Registration in its doc comment. (#338)
As a brand new reader of the mnemos kernel docs, this was a bit difficult to discover. I started at `Registry::register`, and saw that it requires a `Registration`. But `Registration` has no constructor, and its docs didn't mention how one is created.
1 parent 026d0b8 commit 6d191e2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/kernel/src/registry/listener.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pub struct Listener<D: RegisteredDriver> {
1717
/// A registration for a [`RegisteredDriver`]. This type is provided to
1818
/// [`Registry::register`] in order to add the driver to the registry.
1919
///
20+
/// Call [`Listener::new`] to get a `Listener`/`Registration` pair.
21+
///
2022
/// [`Registry::register`]: crate::registry::Registry::register
2123
#[must_use = "a `Registration` does nothing if not registered with a `Registry`"]
2224
pub struct Registration<D: RegisteredDriver> {

0 commit comments

Comments
 (0)