Skip to content

Commit

Permalink
Specify how to create a Registration in its doc comment.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
BGR360 authored Oct 3, 2024
1 parent ff7610c commit 8c9693b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/kernel/src/registry/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pub struct Listener<D: RegisteredDriver> {
/// A registration for a [`RegisteredDriver`]. This type is provided to
/// [`Registry::register`] in order to add the driver to the registry.
///
/// Call [`Listener::new`] to get a `Listener`/`Registration` pair.
///
/// [`Registry::register`]: crate::registry::Registry::register
#[must_use = "a `Registration` does nothing if not registered with a `Registry`"]
pub struct Registration<D: RegisteredDriver> {
Expand Down

0 comments on commit 8c9693b

Please sign in to comment.