Add servercom library to make building voltlane servers easier#11
Merged
Add servercom library to make building voltlane servers easier#11
servercom library to make building voltlane servers easier#11Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new library “servercom” to simplify constructing voltlane servers and updates the connserver module to adopt new async function signatures without async-trait.
- Added MasterServer trait and ServerCore struct in servercom for handling client connections.
- Updated Cargo.toml workspaces to include the new servercom crate.
- Modified the MasterDuplex trait in connserver to use new async function signatures.
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| servercom/src/lib.rs | Introduces new traits and a core server structure utilizing new async closure patterns. |
| servercom/Cargo.toml | Defines the new servercom package and its dependencies. |
| connserver/src/master.rs | Updates MasterDuplex trait to use impl Future return types instead of async_trait. |
| connserver/Cargo.toml | Removes the dependency on async-trait in favor of new async function syntax. |
| Cargo.toml | Updates workspace members to include servercom. |
Comments suppressed due to low confidence (2)
servercom/src/lib.rs:10
- It is unclear whether AsyncFnMut is a custom trait or imported from a dependency; consider adding documentation or an explicit import to clarify its origin and expected behavior.
send_packet: impl AsyncFnMut(net::TaggedPacket) -> anyhow::Result<()>,
connserver/src/master.rs:11
- Ensure that the future returned by implementations of send_packet satisfies the Send bound as required by the trait to maintain consistency with asynchronous usage across the codebase.
fn send_packet(&mut self, packet: TaggedPacket) -> impl Future<Output = anyhow::Result<()>> + Send;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
servercommodule; used soon in voltchat as a demo.