Skip to content

KeyboardApi methods return Result<T> instead of Option<T>#3

Merged
srwi merged 1 commit intosrwi:masterfrom
irobot:feat/api-error-handling
Oct 11, 2025
Merged

KeyboardApi methods return Result<T> instead of Option<T>#3
srwi merged 1 commit intosrwi:masterfrom
irobot:feat/api-error-handling

Conversation

@irobot
Copy link
Contributor

@irobot irobot commented Sep 30, 2025

  • Introduce a unified Error enum.
  • Update all KeyboardApi methods to return Result<T>.
  • Implement From<Error> for pyo3::PyErr to support Python bindings.

BREAKING CHANGE: KeyboardApi methods now return Result<T> instead of Option<T>

- Introduce a unified `Error` enum.
- Update all `KeyboardApi` methods to return `Result<T>`.
- Implement `From<Error>` for `pyo3::PyErr` to support Python bindings.

BREAKING CHANGE: `KeyboardApi` methods now return `Result<T>` instead of `Option<T>`
@srwi srwi self-requested a review October 1, 2025 20:55
@srwi
Copy link
Owner

srwi commented Oct 5, 2025

Thank you for the PR! I haven't had the time to look into it. Will do so in the coming days!

@irobot
Copy link
Contributor Author

irobot commented Oct 5, 2025

Thank you, and no worries! I know it looks like a lot, but the bulk of it is simply replacing Option<> with Result<>. The rest is just error formatting. Whenever you get to it, do let me know if you have questions.

@srwi
Copy link
Owner

srwi commented Oct 11, 2025

Finally got to have a closer look. I like the changes. Thanks again for the contribution! 🙂

@srwi srwi merged commit b5be255 into srwi:master Oct 11, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants