Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 86518a1

Browse files
committed
doc: deny rustdoc::broken_intra_doc_links
1 parent 656abaf commit 86518a1

18 files changed

Lines changed: 34 additions & 17 deletions

File tree

compio-buf/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#![cfg_attr(feature = "read_buf", feature(read_buf, core_io_borrowed_buf))]
1010
#![cfg_attr(feature = "try_trait_v2", feature(try_trait_v2, try_trait_v2_residual))]
1111
#![warn(missing_docs)]
12+
#![deny(rustdoc::broken_intra_doc_links)]
1213

1314
#[cfg(feature = "arrayvec")]
1415
pub use arrayvec;

compio-buf/src/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl<T> IntoInner for Slice<T> {
173173
///
174174
/// - [`IoVectoredBuf::slice`]: Ignore uninitialized slots, i.e., skip
175175
/// `begin`-many **initialized** bytes.
176-
/// - [`IoVectoredBuf::slice_mut`]: Consider uninitialized slots, i.e., skip
176+
/// - [`IoVectoredBufMut::slice_mut`]: Consider uninitialized slots, i.e., skip
177177
/// `begin`-many bytes.
178178
///
179179
/// This will only affect how the slice is being constructed. The resulting

compio-buf/src/uninit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::*;
44

55
/// A [`Slice`] that only exposes uninitialized bytes.
66
///
7-
/// [`Uninit`] can be created with [`IoBuf::uninit`].
7+
/// [`Uninit`] can be created with [`IoBufMut::uninit`].
88
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
99
pub struct Uninit<T>(Slice<T>);
1010

compio-dispatcher/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Multithreading dispatcher.
22
33
#![warn(missing_docs)]
4+
#![deny(rustdoc::broken_intra_doc_links)]
45

56
use std::{
67
collections::HashSet,

compio-driver/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#![cfg_attr(docsrs, feature(doc_cfg))]
66
#![cfg_attr(feature = "once_cell_try", feature(once_cell_try))]
77
#![warn(missing_docs)]
8+
#![deny(rustdoc::broken_intra_doc_links)]
89

910
use std::{
1011
io,

compio-fs/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
#![cfg_attr(docsrs, feature(doc_cfg))]
44
#![warn(missing_docs)]
5+
#![deny(rustdoc::broken_intra_doc_links)]
56
#![cfg_attr(feature = "read_buf", feature(read_buf, core_io_borrowed_buf))]
67
#![cfg_attr(
78
all(windows, feature = "windows_by_handle"),

compio-io/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
//! ```
107107
108108
#![warn(missing_docs)]
109+
#![deny(rustdoc::broken_intra_doc_links)]
109110
// This is OK as we're thread-per-core and don't need `Send` or other auto trait on anonymous future
110111
#![allow(async_fn_in_trait)]
111112
#![cfg_attr(feature = "allocator_api", feature(allocator_api))]

compio-net/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#![cfg_attr(docsrs, feature(doc_cfg))]
66
#![cfg_attr(feature = "once_cell_try", feature(once_cell_try))]
77
#![warn(missing_docs)]
8+
#![deny(rustdoc::broken_intra_doc_links)]
89

910
mod cmsg;
1011
mod opts;
@@ -17,7 +18,7 @@ mod udp;
1718
mod unix;
1819

1920
pub use cmsg::*;
20-
pub use opts::TcpOpts;
21+
pub use opts::SocketOpts;
2122
pub use poll_fd::*;
2223
pub use resolve::ToSocketAddrsAsync;
2324
pub(crate) use resolve::{each_addr, first_addr_buf};

compio-net/src/opts.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ use std::time::Duration;
22

33
use crate::Socket;
44

5-
/// Options for configuring TCP sockets.
6-
/// By default, SO_REUSEADDR is enabled.
5+
/// Options for configuring Socket sockets.
6+
///
7+
/// # Default Options
8+
/// By default, `reuse_address` is enabled. You can disable it by calling
9+
/// `reuse_address(false)`.
710
#[derive(Default, Debug, Copy, Clone)]
8-
pub struct TcpOpts {
11+
pub struct SocketOpts {
912
recv_buffer_size: Option<usize>,
1013
send_buffer_size: Option<usize>,
1114
keepalive: Option<bool>,
@@ -17,10 +20,10 @@ pub struct TcpOpts {
1720
nodelay: Option<bool>,
1821
}
1922

20-
impl TcpOpts {
23+
impl SocketOpts {
2124
/// Creates a new `TcpOpts` with default settings.
2225
pub fn new() -> Self {
23-
TcpOpts::default()
26+
SocketOpts::default()
2427
}
2528

2629
/// Sets the receive buffer size for the TCP socket.

compio-net/src/tcp.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use compio_runtime::{BorrowedBuffer, BufferPool};
77
use socket2::{Protocol, SockAddr, Socket as Socket2, Type};
88

99
use crate::{
10-
OwnedReadHalf, OwnedWriteHalf, PollFd, ReadHalf, Socket, TcpOpts, ToSocketAddrsAsync, WriteHalf,
10+
OwnedReadHalf, OwnedWriteHalf, PollFd, ReadHalf, Socket, SocketOpts, ToSocketAddrsAsync,
11+
WriteHalf,
1112
};
1213

1314
/// A TCP socket server, listening for connections.
@@ -56,7 +57,7 @@ impl TcpListener {
5657
/// Binding with a port number of 0 will request that the OS assigns a port
5758
/// to this listener.
5859
pub async fn bind(addr: impl ToSocketAddrsAsync) -> io::Result<Self> {
59-
Self::bind_with_options(addr, TcpOpts::default().reuse_address(true)).await
60+
Self::bind_with_options(addr, SocketOpts::default().reuse_address(true)).await
6061
}
6162

6263
/// Creates a new `TcpListener`, which will be bound to the specified
@@ -68,7 +69,7 @@ impl TcpListener {
6869
/// to this listener.
6970
pub async fn bind_with_options(
7071
addr: impl ToSocketAddrsAsync,
71-
options: TcpOpts,
72+
options: SocketOpts,
7273
) -> io::Result<Self> {
7374
super::each_addr(addr, |addr| async move {
7475
let sa = SockAddr::from(addr);
@@ -172,14 +173,14 @@ impl TcpStream {
172173
/// Opens a TCP connection to a remote host using `TcpOpts`.
173174
pub async fn connect_with_options(
174175
addr: impl ToSocketAddrsAsync,
175-
options: TcpOpts,
176+
options: SocketOpts,
176177
) -> io::Result<Self> {
177178
Self::connect_base(addr, Some(options)).await
178179
}
179180

180181
async fn connect_base(
181182
addr: impl ToSocketAddrsAsync,
182-
options: Option<TcpOpts>,
183+
options: Option<SocketOpts>,
183184
) -> io::Result<Self> {
184185
use std::net::{Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6};
185186

@@ -222,15 +223,15 @@ impl TcpStream {
222223
pub async fn bind_and_connect_with_options(
223224
bind_addr: SocketAddr,
224225
addr: impl ToSocketAddrsAsync,
225-
options: TcpOpts,
226+
options: SocketOpts,
226227
) -> io::Result<Self> {
227228
Self::bind_and_connect_base(bind_addr, addr, Some(options)).await
228229
}
229230

230231
async fn bind_and_connect_base(
231232
bind_addr: SocketAddr,
232233
addr: impl ToSocketAddrsAsync,
233-
options: Option<TcpOpts>,
234+
options: Option<SocketOpts>,
234235
) -> io::Result<Self> {
235236
let options = options.unwrap_or_default();
236237
super::each_addr(addr, |addr| async move {

0 commit comments

Comments
 (0)