Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framing refactor: test Sv2Frame and HandShakeFrame #1049

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Commits on Jul 16, 2024

  1. Constrain T and B generics

    `Frame` is defined with `T` and `B` generics but the constraints are
    only introduced in the impl level which makes it harder to read the enum
    and understand whats those generics are about. As those generics are a
    key part of the `Frame` enum, it makes more sense to introduce the
    constraints in the enum level.
    jbesraa committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    3a2cff3 View commit details
    Browse the repository at this point in the history
  2. Change payload fn signature to return Option

    ..instead of panicking
    jbesraa committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    86f085b View commit details
    Browse the repository at this point in the history
  3. Change Sv2Frame::get_header to header and ..

    Remove `Option` from its return type.
    jbesraa committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    33dc060 View commit details
    Browse the repository at this point in the history
  4. Change Sv2Frame from struct to enum

    `Sv2Frame` can handle serialized and non-serliazed data, both scenarios
    were previously in the same struct wrapped by Option, where if one is
    Some, the other is None but never both None or Some.
    jbesraa committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    3c322e4 View commit details
    Browse the repository at this point in the history
  5. Remove redundant tests

    jbesraa committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    3b11866 View commit details
    Browse the repository at this point in the history
  6. Reorder functions in impl

    In `Sv2Frame` and `HandShakeFrame` put initialisers at the top
    jbesraa committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    302670d View commit details
    Browse the repository at this point in the history
  7. Move handshake_message_to_frame to..

    `HandShakeFrame` as `HandShake::from_message`
    jbesraa committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    07f18c7 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    05f9b4c View commit details
    Browse the repository at this point in the history