Datetime traits

Open
#207 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust
Domain
embedded-iot

Research direction

Begin with the existing InputPin traits in embedded-hal and the no_std constraints described in the issue; compare the chrono::Datetime and ds323x::DateTime APIs. No files or tests are named, so first establish the trait scope and compatibility expectations with maintainers. Done would be an agreed design followed by a corresponding PR.

Written by the indexing model from the issue text.

Description

discussion enhancement

What are your thoughts on Datetime, Time, Date etc traits? They seem like a good fit because they're not available natively on no_std, are a common feature. It would be nice to be able to write general functions using these traits, instead of platform-specific ones.

Ie, make it so you don't have to hard-code functions to accept chrono::Datetime (eg a computer) or ds323x::DateTime (eg ds3231).

This feels higher-level than existing traits, but I'd argue it fits well with the concept of code portability across devices, which is a big (the main?) draw of this project. I we can currently write device-agnostic code using InputPin, but not dates/times/datetimes.

If y'all like it, I'll draft a PR.

Dominant language
Rust
Stars
2.7k
Forks
282
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-embedded/embedded-hal

All issues in rust-embedded/embedded-hal

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.