Skip to content

Encapsulate relay::client::Connection into an Newtype type that only exposes AsyncRead and AsyncWrite #3255

Closed

Description

@jxs

Motivation

As per #3238/files#r1050261660 Connection is a public enum variant with struct variants, any change to it becomes a subsequent breaking change.

Desired changes

Encapsulate that one into an Newtype that only exposes AsyncRead and AsyncWrite as its interface:

  • Rename the type to ConnectionState & make it private
  • Create a struct Connection as Newtype that encapsulates ConnectionState.
  • Move the AsyncRead and AsyncWrite implementations from the enum to the struct

this depends on #3238 as it renames RelayedConnection to Connection and is itself a breaking change. Probably should also wait on the discussion started on #3221 (comment).

CC @thomaseizinger

Are you planning to do it yourself in a pull request?

Yes if required.

Activity

  1. added
    getting-startedIssues that can be tackled if you don't know the internals of libp2p very well
    on Dec 16, 2022
  2. mxinden commented on Dec 19, 2022

    @mxinden
    Member

    Sounds good to me. Thanks for documenting it.

  3. Danijel-Enoch commented on Feb 10, 2023

    @Danijel-Enoch

    Hello guys I am new to Open Source Contribution . Can I try this?

  4. thomaseizinger commented on Feb 10, 2023

    @thomaseizinger
    Contributor

    Hello guys I am new to Open Source Contribution . Can I try this?

    Sure thing! Let me know if you need more mentoring or any other help :)
    Best to have a go yourself and open a draft PR if you get stuck, then we can discuss things there!

  5. Danijel-Enoch commented on Feb 10, 2023

    @Danijel-Enoch

    Thanks
    Would get started

  6. added a commit that references this issue on May 2, 2023
    c728824
  7. added a commit that references this issue on Oct 16, 2026
    b30c005
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

    difficulty:easygetting-startedIssues that can be tackled if you don't know the internals of libp2p very well

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions