Skip to content

Commit b76e87c

Browse files
committed
Document fallibility policy
1 parent 43a8c69 commit b76e87c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
//! advantage for application developers is that by adopting `embedded-hal` they can unlock all
3535
//! these drivers for their platform.
3636
//!
37+
//! - Trait methods must be fallible so that they can be used in any possible situation.
38+
//! Nevertheless, HAL implementations can additionally provide infallible versions of the same methods
39+
//! if they can never fail in their platform. This way, generic code can use the fallible abstractions
40+
//! provided here but platform-specific code can avoid fallibility-related boilerplate if possible.
41+
//!
3742
//! # Out of scope
3843
//!
3944
//! - Initialization and configuration stuff like "ensure this serial interface and that SPI

0 commit comments

Comments
 (0)