Skip to content

docs(fs,net): comments on close - #821

Merged
Berrysoft merged 4 commits into
compio-rs:masterfrom
Berrysoft:dev/close-details
Mar 31, 2026
Merged

Berrysoft merged 4 commits into
compio-rs:masterfrom
Berrysoft:dev/close-details

Conversation

@Berrysoft

Copy link
Copy Markdown
Member

Also add the lacking close for named pipe.

Close #819

@Berrysoft
Berrysoft requested a review from Copilot March 31, 2026 11:49
@Berrysoft Berrysoft self-assigned this Mar 31, 2026
@Berrysoft Berrysoft added documentation Improvements or additions to documentation package: net Related to compio-net package: fs Related to compio-fs labels Mar 31, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR clarifies the semantics of async close() across FS and net types (especially around clonability and dropped futures), and adds missing close() APIs for Windows named pipes to address the Clone vs close confusion raised in #819.

Changes:

  • Add cross-references in close() rustdocs for multiple socket types to point to the detailed TcpStream::close semantics.
  • Expand File::close and TcpStream::close documentation to explain clone-related completion behavior and pending-operation implications.
  • Add close() methods for NamedPipeServer and NamedPipeClient (and refactor the underlying handle wrapper to use compio_fs::File).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
compio-net/src/unix.rs Adds rustdoc cross-reference to TcpStream::close for Unix socket close semantics.
compio-net/src/udp.rs Adds rustdoc cross-reference to TcpStream::close for UDP close semantics.
compio-net/src/tcp.rs Adds rustdoc cross-reference for listener close; expands TcpStream::close docs with clone/pending-op caveats.
compio-fs/src/pipe/mod.rs Adds rustdoc cross-reference to File::close for FIFO sender/receiver close semantics.
compio-fs/src/named_pipe.rs Adds missing close() for named pipe server/client and switches internal handle wrapper to File.
compio-fs/src/file.rs Expands File::close docs with clone/pending-op caveats.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread compio-fs/src/named_pipe.rs Resolved
Comment thread compio-net/src/tcp.rs Resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Berrysoft
Berrysoft requested a review from George-Miao March 31, 2026 12:01

@George-Miao George-Miao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@Berrysoft
Berrysoft added this pull request to the merge queue Mar 31, 2026
Merged via the queue into compio-rs:master with commit 83d6b79 Mar 31, 2026
116 of 120 checks passed
@Berrysoft
Berrysoft deleted the dev/close-details branch March 31, 2026 15:38
@github-actions github-actions Bot mentioned this pull request Mar 31, 2026
This was referenced Apr 21, 2026
@github-actions github-actions Bot mentioned this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation package: fs Related to compio-fs package: net Related to compio-net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: solve the contradiction of Clone and close

3 participants