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

proto: Connection side enum #2084

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gretchenfrage
Copy link
Contributor

Some notable differences from how I approached this in #1912:

  • Calling it ConnectionSide rather than SideState
  • Call the field Connection.side rather than Connection.side_state. The causes changes to be necessary to a different, but smaller set of lines of code, since now every existing instance of self.side.is_client() or self.side.is_server() just works as-is. And it's terser.
  • Offloaded more logic to methods on SideArgs and an impl From<SideArgs> for ConnectionSide, in the interest of taking some complexity load off of Connection::new, which is already over 100 lines.

quinn-proto/src/connection/mod.rs Outdated Show resolved Hide resolved
@gretchenfrage gretchenfrage force-pushed the connection-side-enum branch 2 times, most recently from 9395751 to ea8bb80 Compare December 14, 2024 21:00
@gretchenfrage gretchenfrage changed the title Connection side enum proto: Connection side enum Dec 14, 2024
Moves server/client-specific fields of proto::Connection to a new
SideState enum.
Server/client-specific args to proto::Connection::new are now passed
through a new SideArgs enum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants