Skip to content

Commit 16bd944

Browse files
committed
Make Qei methods fallible
1 parent f4e776c commit 16bd944

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -974,14 +974,17 @@ pub trait PwmPin {
974974
// reason: needs to be re-evaluated in the new singletons world. At the very least this needs a
975975
// reference implementation
976976
pub trait Qei {
977+
/// Enumeration of `Qei` errors
978+
type Error;
979+
977980
/// The type of the value returned by `count`
978981
type Count;
979982

980983
/// Returns the current pulse count of the encoder
981-
fn count(&self) -> Self::Count;
984+
fn count(&self) -> Result<Self::Count, Self::Error>;
982985

983986
/// Returns the count direction
984-
fn direction(&self) -> Direction;
987+
fn direction(&self) -> Result<Direction, Self::Error>;
985988
}
986989

987990
/// Count direction

0 commit comments

Comments
 (0)