Skip to content

Commit adc0065

Browse files
BerrysoftCopilot
andauthored
fix: apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent e17e05e commit adc0065

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

content/docs/compio/buffers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Crate `compio-buf` is fundamental to `compio`. It provides abstractions for diff
44

55
## Buffer traits
66

7-
The trait `IoBuf` is the abstract of read-only buffers. Trait `IoBufMut` provides writing methods in addition, and supports extending the buffer. A write operation can only write into the allocated space, but cannot extend the vector automatically.
7+
The trait `IoBuf` is the abstract of read-only buffers. Trait `IoBufMut` provides writing methods in addition. It allows you to extend the buffer via explicit APIs, but I/O write operations themselves can only write into the already-allocated space and will not automatically grow the underlying vector.
88

99
`IoBuf` & `IoBufMut` represent owned buffers. The IO operations always require the ownership of a buffer to avoid potential race conditions. Although the traits implement for arrays `[u8; N]`, it's not a good idea to use them as buffer type, because the move operation of them is relatively slow. Use `Vec<u8>` or `Box<[u8]>` instead.
1010

content/docs/compio/driver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ The `Proactor` provides a simple cancellation mechanism. The cancellation of an
2222

2323
## Shared FDs
2424

25-
"File descriptors" in `compio` represents the file descriptors on Unix and handles on Windows. When the driver is holding the operations, it should also hold the reference of the related fds. Therefore, all fds are wrapped inside an `Rc`/`Arc`, depending on the feature `"sync"`. When a file or socket is cloned, the inner `Rc`/`Arc` is cloned, rather than duplicating (e.g., with `dup`) the fds or handles. When the method `close` is called on a file or socket, the future will wait for all related operations to complete. Therefore, it's not a good idea to close a cloned file or socket.
25+
"File descriptors" in `compio` represent the file descriptors on Unix and handles on Windows. When the driver is holding the operations, it should also hold the reference of the related fds. Therefore, all fds are wrapped inside an `Rc`/`Arc`, depending on the feature `"sync"`. When a file or socket is cloned, the inner `Rc`/`Arc` is cloned, rather than duplicating (e.g., with `dup`) the fds or handles. When the method `close` is called on a file or socket, the future will wait for all related operations to complete. Therefore, it's not a good idea to close a cloned file or socket.

content/docs/compio/net.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Networking
22

3-
`compio-net` provides most networking affairs. TCP, UDP, Unix sockets are supported. The TLS support is in `compio-tls`, the QUIC support is in `compio-quic`, and the WebSocket support is in `compio-ws`. For high level HTTP support, see `cyper`.
3+
`compio-net` provides most networking affairs. TCP, UDP, Unix sockets are supported. The TLS support is in `compio-tls`, the QUIC support is in `compio-quic`, and the WebSocket support is in `compio-ws`. For high-level HTTP support, see `cyper`.
44

55
Sockets in `compio` expose completion-based APIs. If it is too confusing to use, `PollFd` is provided for all kinds of socket resources, and exposes ready-based APIs.

content/docs/compio/net/sockets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Windows _does_ support Unix sockets, with some limitations. A Unix socket on Win
2424

2525
## Control messages of UDP sockets
2626

27-
There are `send_msg*` and `recv_msg*` methods in `UdpSocket`. They retrieve ancillary data as raw buffers. The users are responsible to align the buffer correctly.
27+
There are `send_msg*` and `recv_msg*` methods in `UdpSocket`. They retrieve ancillary data as raw buffers. Users are responsible for aligning the buffer correctly.

content/docs/summary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const compio: Section[] = [
3636
['Signal', '/docs/compio/signal'],
3737
['Process', '/docs/compio/process'],
3838
['TLS', '/docs/compio/tls'],
39-
['WebSocket', "/docs/compio/ws"]
39+
['WebSocket', '/docs/compio/ws'],
4040
// [['QUIC', 'compio/quic'], [['HTTP 3', 'compio/quic/http3']]], // TODO(@AsakuraMizu): Write this
4141
]
4242

0 commit comments

Comments
 (0)