Skip to content

Make required header fields infallible after parsing #301

Description

@davidsteiner

Problem

After a message passes validation (ParsedMessage::Valid), required header fields like MsgSeqNum and MsgType are guaranteed to exist.

However, accessing them still returns Result, forcing call sites to handle impossible errors with expect() or propagate errors that can never occur.

Suggestion

The Header type could expose required fields as infallible accessors (e.g., header.msg_seq_num() -> u64) populated during parsing, while keeping the flexible .get() API for optional fields.

Activity

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