Skip to content

Missing Builder derive for MillisecondTimestamp? #1137

Closed

Description

@DirkRusche-Otto

I was trying to instantiate a KafkaRecord and the builder exposes a timestamp method that lets me pass a MillisecondTimestamp. But unfortunately I couldn't find a way to construct the MillisecondTimestamp struct (without using Deserialize - which feels a bit awkward to use).

So I guess there is a #[cfg_attr(feature = "builders", derive(Builder))] missing?

Activity

  1. jlizen commented on Apr 14, 2026

    @jlizen
    Member

    Yeah, looks like they are needed here:
    https://github.com/aws/aws-lambda-rust-runtime/blob/main/lambda-events/src/encodings/time.rs

    Another option is to just chain through chrono setters for from_systemtime_and_offset or other ergonomic constructors. Technically the non exhaustive signals that we might add future fields, but that seems unlikely to me, and they would surely be optional.

    PR welcome!

  2. DirkRusche-Otto commented on Apr 15, 2026

    @DirkRusche-Otto
    ContributorAuthor

    Thanks for your quick response. I can prepare a PR, can you give me more precise instructions what solution you would prefer?

  3. jlizen commented on Apr 15, 2026

    @jlizen
    Member

    We definitely want derive(Builder), like you suggested.

    If you find the ergonomics for setting it poor, I don't mind MillisecondTimestamp::from_systemtime_and_offset() as a supplementary change. Up to you if you want to add it, I'd accept it.

    If you don't mind adding the same for builder / optionally the direct constructor to the other types (SecondTimestamp, etc), I think they need it too.

  4. DirkRusche-Otto commented on Apr 16, 2026

    @DirkRusche-Otto
    ContributorAuthor

    Here you go #1138

  5. github-actions commented on Apr 16, 2026

    @github-actions

    This issue is now closed. Comments on closed issues are hard for our team to see.
    If you need more assistance, please either tag a team member or open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions