Skip to content

feat(tokio-boring): Overhaul crate API - #109

Merged
0x676e67 merged 2 commits into
masterfrom
feat
Jan 1, 2026
Merged

feat(tokio-boring): Overhaul crate API#109
0x676e67 merged 2 commits into
masterfrom
feat

Conversation

@0x676e67

@0x676e67 0x676e67 commented Jan 1, 2026

Copy link
Copy Markdown
Owner

No description provided.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @0x676e67, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a major refactoring of the tokio-boring crate, bringing its asynchronous TLS stream implementation in line with the design principles of the overhauled tokio-openssl library. The core SslStream has been simplified, directly leveraging boring::ssl::SslStream and replacing custom bridging logic with a new StreamWrapper. This change streamlines the API, making it more idiomatic for Tokio's asynchronous ecosystem by exposing direct polling methods for TLS handshakes and I/O operations, and includes a new feature for uninitialized reads.

Highlights

  • API Overhaul: The crate's API has been significantly refactored to align with the overhauled tokio-openssl interface, simplifying the asynchronous TLS stream implementation.
  • Simplified SslStream: The SslStream type is now a direct wrapper around boring::ssl::SslStream, removing intermediate bridging components like AsyncStreamBridge and HandshakeFuture.
  • Direct Polling Methods: New poll_connect, poll_accept, and poll_do_handshake methods are exposed, providing direct control over TLS handshake operations in an asynchronous context.
  • New StreamWrapper: A StreamWrapper struct has been introduced to manage the underlying stream and Context for efficient polling, replacing the previous AsyncStreamBridge.
  • Conditional read_uninit Feature: A new read_uninit feature has been added to Cargo.toml, enabling optimized AsyncRead implementations for SslStream when available.
  • Test and Example Refactoring: The simple-async.rs example and several test files (async_custom_verify.rs, async_get_session.rs, async_private_key_method.rs, client_server.rs, common/mod.rs) have been removed or replaced by a new, consolidated test.rs module within src/lib.rs.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a significant and valuable overhaul of the tokio-boring crate's API, aligning it with the modern tokio-openssl interface. The changes simplify the crate by removing the custom handshake and bridge implementations in favor of a more direct StreamWrapper approach. This makes the API more idiomatic and consistent with the broader Tokio ecosystem. My review identified a critical panic-safety issue in the new with_context helper function that could lead to memory safety violations. I have provided suggestions to resolve this. Additionally, I've included a recommendation to improve test organization. Overall, this is a great improvement for the crate.

Comment thread tokio-boring/src/lib.rs Outdated
Comment thread tokio-boring/src/lib.rs
Comment thread tokio-boring/src/lib.rs
@0x676e67
0x676e67 merged commit ca79b64 into master Jan 1, 2026
26 checks passed
@0x676e67
0x676e67 deleted the feat branch January 1, 2026 13:11
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.

1 participant