Skip to content

Commit 8446a11

Browse files
committed
Move new trait how-to into separate document
1 parent ddf4375 commit 8446a11

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

README.md

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ these drivers for their platform.
3030

3131
For functionality that goes beyond what is provided by `embedded-hal`, users are encouraged
3232
to use the target platform directly. Abstractions of common functionality can be proposed to be
33-
included into `embedded-hal` as described [below](#how-to-add-a-new-trait), though.
33+
included into `embedded-hal` as described [in this guide](docs/how-to-add-a-new-trait.md), though.
3434

3535
See more about the design goals in [this documentation section](https://docs.rs/embedded-hal/latest/embedded_hal/#design-goals).
3636

@@ -48,36 +48,11 @@ side by side in a HAL.
4848

4949
[#177]: https://github.com/rust-embedded/embedded-hal/issues/177
5050

51-
## How-to: add a new trait
52-
53-
This is the suggested approach to adding a new trait to `embedded-hal`
54-
55-
### Research / Discussion
56-
57-
Ideally, before proposing a new trait, or set of traits, you should check for an existing issue
58-
suggesting the need for the trait, as well as any related works / use cases / requirements that
59-
are useful to consider in the design of the trait.
60-
61-
These issues will be labeled as `discussion` in the issue tracker.
62-
63-
### Implementation / Demonstration
64-
65-
Proposed traits should then be implemented and demonstrated, either by forking `embedded-hal` or by creating a new crate with the intent of integrating this into `embedded-hal` once the traits have stabilized. You may find [cargo workspaces](https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html) and [patch](https://doc.rust-lang.org/edition-guide/rust-2018/cargo-and-crates-io/replacing-dependencies-with-patch.html) useful for the forking approach.
66-
67-
Traits should be demonstrated with at least *two* implementations on different platforms and *one* generic driver built on the trait. Where it is possible we suggest an implementation on a microcontroller, and implementation for [linux](https://github.com/rust-embedded/linux-embedded-hal), and a driver (or drivers where requirements are more complex) with bounds using the trait.
68-
69-
### Proposing a trait
70-
71-
Once the trait has been demonstrated a PR should be opened to merge the new trait(s) into `embedded-hal`. This should include a link to the previous discussion issue.
72-
73-
If there is determined to be more than one alternative then there should be further discussion to
74-
try to single out the best option. Once there is consensus this will be merged into the `embedded-hal` repository.
75-
76-
These issues / PRs will be labeled as `proposal`s in the issue tracker.
51+
## Documents
7752

53+
- [How-to: add a new trait](docs/how-to-add-a-new-trait.md)
7854

7955
## Implementations and drivers
80-
8156
For a list of `embedded-hal` implementations and driver crates check the [awesome-embedded-rust]
8257
list.
8358

docs/how-to-add-a-new-trait.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# How-to: add a new trait
2+
3+
This is the suggested approach to adding a new trait to `embedded-hal`
4+
5+
## Research / Discussion
6+
7+
Ideally, before proposing a new trait, or set of traits, you should check for an existing issue
8+
suggesting the need for the trait, as well as any related works / use cases / requirements that
9+
are useful to consider in the design of the trait.
10+
11+
These issues will be labeled as `discussion` in the issue tracker.
12+
13+
## Implementation / Demonstration
14+
15+
Proposed traits should then be implemented and demonstrated, either by forking `embedded-hal` or by creating a new crate with the intent of integrating this into `embedded-hal` once the traits have stabilized. You may find [cargo workspaces](https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html) and [patch](https://doc.rust-lang.org/edition-guide/rust-2018/cargo-and-crates-io/replacing-dependencies-with-patch.html) useful for the forking approach.
16+
17+
Traits should be demonstrated with at least *two* implementations on different platforms and *one* generic driver built on the trait. Where it is possible we suggest an implementation on a microcontroller, and implementation for [linux](https://github.com/rust-embedded/linux-embedded-hal), and a driver (or drivers where requirements are more complex) with bounds using the trait.
18+
19+
## Proposing a trait
20+
21+
Once the trait has been demonstrated a PR should be opened to merge the new trait(s) into `embedded-hal`. This should include a link to the previous discussion issue.
22+
23+
If there is determined to be more than one alternative then there should be further discussion to
24+
try to single out the best option. Once there is consensus this will be merged into the `embedded-hal` repository.
25+
26+
These issues / PRs will be labeled as `proposal`s in the issue tracker.

0 commit comments

Comments
 (0)