Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
improve README.md on what subsystem and contextbounds proc macros do
Browse files Browse the repository at this point in the history
  • Loading branch information
drahnr committed May 12, 2022
1 parent 56aff7c commit 8f76d68
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions node/overseer/overseer-gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ declarative.
being consumed by that particular subsystem. Each of those subsystems is required to implement the subsystem
trait with the correct trait bounds. Commonly this is achieved
by using `#[subsystem]` and `#[contextbounds]` macro.
* `#[contextbounds(Foo, error=Yikes, prefix=wherethetraitsat)]` can applied to `impl`-blocks and `fn`-blocks. It will add additional trait bounds for the generic `Context` with `Context: FooContextTrait` for `<Context as FooContextTrait>::Sender: FooSenderTrait` besides a few more. Note that `Foo` here references the name of the subsystem as declared in `#[overlord(..)]` macro.
* `#[subsystem(Foo, error=Yikes, prefix=wherethetraitsat)]` is a extension to the above, implementing `trait Subsystem<Context, Yikes>`.
* `error=` tells the overseer to use the user provided
error type, if not provided a builtin one is used. Note that this is the one error type used throughout all calls, so make sure it does impl `From<E>` for all other error types `E` that are relevant to your application.
* `event=` declares an external event type, that injects certain events
Expand Down

0 comments on commit 8f76d68

Please sign in to comment.