Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc aliases for bind, connect, and send_to functions. #326

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cap-async-std/src/fs/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`async_std::os::unix::net::UnixListener::bind`]: https://docs.rs/async-std/latest/async_std/os/unix/net/struct.UnixListener.html#method.bind
#[doc(alias = "bind")]
#[cfg(unix)]
#[inline]
pub async fn bind_unix_listener<P: AsRef<Path>>(&self, path: P) -> io::Result<UnixListener> {
Expand All @@ -680,6 +681,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`async_std::os::unix::net::UnixStream::connect`]: https://docs.rs/async-std/latest/async_std/os/unix/net/struct.UnixStream.html#method.connect
#[doc(alias = "connect")]
#[cfg(unix)]
#[inline]
pub async fn connect_unix_stream<P: AsRef<Path>>(&self, path: P) -> io::Result<UnixStream> {
Expand All @@ -698,6 +700,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`async_std::os::unix::net::UnixDatagram::bind`]: https://docs.rs/async-std/latest/async_std/os/unix/net/struct.UnixDatagram.html#method.bind
#[doc(alias = "bind")]
#[cfg(unix)]
#[inline]
pub async fn bind_unix_datagram<P: AsRef<Path>>(&self, path: P) -> io::Result<UnixDatagram> {
Expand All @@ -717,6 +720,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`async_std::os::unix::net::UnixDatagram::connect`]: https://docs.rs/async-std/latest/async_std/os/unix/net/struct.UnixDatagram.html#method.connect
#[doc(alias = "connect")]
#[cfg(unix)]
#[inline]
pub async fn connect_unix_datagram<P: AsRef<Path>>(
Expand All @@ -740,6 +744,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`async_std::os::unix::net::UnixDatagram::send_to`]: https://docs.rs/async-std/latest/async_std/os/unix/net/struct.UnixDatagram.html#method.send_to
#[doc(alias = "send_to")]
#[cfg(unix)]
#[inline]
pub async fn send_to_unix_datagram_addr<P: AsRef<Path>>(
Expand Down
5 changes: 5 additions & 0 deletions cap-async-std/src/fs_utf8/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`async_std::os::unix::net::UnixListener::bind`]: https://docs.rs/async-std/latest/async_std/os/unix/net/struct.UnixListener.html#method.bind
#[doc(alias = "bind")]
#[cfg(unix)]
#[inline]
pub async fn bind_unix_listener<P: AsRef<Utf8Path>>(
Expand All @@ -475,6 +476,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`async_std::os::unix::net::UnixStream::connect`]: https://docs.rs/async-std/latest/async_std/os/unix/net/struct.UnixStream.html#method.connect
#[doc(alias = "connect")]
#[cfg(unix)]
#[inline]
pub async fn connect_unix_stream<P: AsRef<Utf8Path>>(&self, path: P) -> io::Result<UnixStream> {
Expand All @@ -490,6 +492,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`async_std::os::unix::net::UnixDatagram::bind`]: https://docs.rs/async-std/latest/async_std/os/unix/net/struct.UnixDatagram.html#method.bind
#[doc(alias = "bind")]
#[cfg(unix)]
#[inline]
pub async fn bind_unix_datagram<P: AsRef<Utf8Path>>(
Expand All @@ -509,6 +512,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`async_std::os::unix::net::UnixDatagram::connect`]: https://docs.rs/async-std/latest/async_std/os/unix/net/struct.UnixDatagram.html#method.connect
#[doc(alias = "connect")]
#[cfg(unix)]
#[inline]
pub async fn connect_unix_datagram<P: AsRef<Utf8Path>>(
Expand All @@ -531,6 +535,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`async_std::os::unix::net::UnixDatagram::send_to`]: https://docs.rs/async-std/latest/async_std/os/unix/net/struct.UnixDatagram.html#method.send_to
#[doc(alias = "send_to")]
#[cfg(unix)]
#[inline]
pub async fn send_to_unix_datagram_addr<P: AsRef<Utf8Path>>(
Expand Down
5 changes: 5 additions & 0 deletions cap-async-std/src/net/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ impl Pool {
/// address.
///
/// This corresponds to [`async_std::net::TcpListener::bind`].
#[doc(alias = "bind")]
#[inline]
pub async fn bind_tcp_listener<A: ToSocketAddrs>(&self, addr: A) -> io::Result<TcpListener> {
let addrs = addr.to_socket_addrs().await?;
Expand All @@ -127,6 +128,7 @@ impl Pool {
/// Creates a new TCP stream connected to the specified address.
///
/// This corresponds to [`async_std::net::TcpStream::connect`].
#[doc(alias = "connect")]
#[inline]
pub async fn connect_tcp_stream<A: ToSocketAddrs>(&self, addr: A) -> io::Result<TcpStream> {
let addrs = addr.to_socket_addrs().await?;
Expand All @@ -151,6 +153,7 @@ impl Pool {
/// Creates a UDP socket from the given address.
///
/// This corresponds to [`async_std::net::UdpSocket::bind`].
#[doc(alias = "bind")]
#[inline]
pub async fn bind_udp_socket<A: ToSocketAddrs>(&self, addr: A) -> io::Result<UdpSocket> {
let addrs = addr.to_socket_addrs().await?;
Expand All @@ -172,6 +175,7 @@ impl Pool {
/// Sends data on the socket to the given address.
///
/// This corresponds to [`async_std::net::UdpSocket::send_to`].
#[doc(alias = "send_to")]
#[inline]
pub async fn send_to_udp_socket_addr<A: ToSocketAddrs>(
&self,
Expand All @@ -193,6 +197,7 @@ impl Pool {
/// Connects the UDP socket to a remote address.
///
/// This corresponds to [`async_std::net::UdpSocket::connect`].
#[doc(alias = "connect")]
#[inline]
pub async fn connect_udp_socket<A: ToSocketAddrs>(
&self,
Expand Down
5 changes: 5 additions & 0 deletions cap-std/src/fs/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`std::os::unix::net::UnixListener::bind`]: https://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.bind
#[doc(alias = "bind")]
#[cfg(unix)]
#[inline]
pub fn bind_unix_listener<P: AsRef<Path>>(&self, path: P) -> io::Result<UnixListener> {
Expand All @@ -496,6 +497,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`std::os::unix::net::UnixStream::connect`]: https://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.connect
#[doc(alias = "connect")]
#[cfg(unix)]
#[inline]
pub fn connect_unix_stream<P: AsRef<Path>>(&self, path: P) -> io::Result<UnixStream> {
Expand All @@ -514,6 +516,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`std::os::unix::net::UnixDatagram::bind`]: https://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.bind
#[doc(alias = "bind")]
#[cfg(unix)]
#[inline]
pub fn bind_unix_datagram<P: AsRef<Path>>(&self, path: P) -> io::Result<UnixDatagram> {
Expand All @@ -532,6 +535,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`std::os::unix::net::UnixDatagram::connect`]: https://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.connect
#[doc(alias = "connect")]
#[cfg(unix)]
#[inline]
pub fn connect_unix_datagram<P: AsRef<Path>>(
Expand All @@ -554,6 +558,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`std::os::unix::net::UnixDatagram::send_to`]: https://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.send_to
#[doc(alias = "send_to")]
#[cfg(unix)]
#[inline]
pub fn send_to_unix_datagram_addr<P: AsRef<Path>>(
Expand Down
5 changes: 5 additions & 0 deletions cap-std/src/fs_utf8/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`std::os::unix::net::UnixListener::bind`]: https://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.bind
#[doc(alias = "bind")]
#[cfg(unix)]
#[inline]
pub fn bind_unix_listener<P: AsRef<Utf8Path>>(&self, path: P) -> io::Result<UnixListener> {
Expand All @@ -463,6 +464,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`std::os::unix::net::UnixStream::connect`]: https://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.connect
#[doc(alias = "connect")]
#[cfg(unix)]
#[inline]
pub fn connect_unix_stream<P: AsRef<Utf8Path>>(&self, path: P) -> io::Result<UnixStream> {
Expand All @@ -478,6 +480,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`std::os::unix::net::UnixDatagram::bind`]: https://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.bind
#[doc(alias = "bind")]
#[cfg(unix)]
#[inline]
pub fn bind_unix_datagram<P: AsRef<Utf8Path>>(&self, path: P) -> io::Result<UnixDatagram> {
Expand All @@ -493,6 +496,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`std::os::unix::net::UnixDatagram::connect`]: https://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.connect
#[doc(alias = "connect")]
#[cfg(unix)]
#[inline]
pub fn connect_unix_datagram<P: AsRef<Utf8Path>>(
Expand All @@ -512,6 +516,7 @@ impl Dir {
/// XXX: This function is not yet implemented.
///
/// [`std::os::unix::net::UnixDatagram::send_to`]: https://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.send_to
#[doc(alias = "send_to")]
#[cfg(unix)]
#[inline]
pub fn send_to_unix_datagram_addr<P: AsRef<Utf8Path>>(
Expand Down
10 changes: 8 additions & 2 deletions cap-std/src/net/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl Pool {

/// Add a specific [`net::SocketAddr`] to the pool.
///
/// # AmbientAuthority
/// # Ambient Authority
///
/// This function allows ambient access to any IP address.
pub fn insert_socket_addr(
Expand Down Expand Up @@ -96,7 +96,7 @@ impl Pool {

/// Add a range of network addresses with a specific port to the pool.
///
/// # AmbientAuthority
/// # Ambient Authority
///
/// This function allows ambient access to any IP address.
pub fn insert_ip_net(
Expand All @@ -112,6 +112,7 @@ impl Pool {
/// address.
///
/// This corresponds to [`std::net::TcpListener::bind`].
#[doc(alias = "bind")]
#[inline]
pub fn bind_tcp_listener<A: ToSocketAddrs>(&self, addr: A) -> io::Result<TcpListener> {
let addrs = addr.to_socket_addrs()?;
Expand All @@ -134,6 +135,7 @@ impl Pool {
/// Opens a TCP connection to a remote host.
///
/// This corresponds to [`std::net::TcpStream::connect`].
#[doc(alias = "connect")]
#[inline]
pub fn connect_tcp_stream<A: ToSocketAddrs>(&self, addr: A) -> io::Result<TcpStream> {
let addrs = addr.to_socket_addrs()?;
Expand All @@ -156,6 +158,7 @@ impl Pool {
/// Opens a TCP connection to a remote host with a timeout.
///
/// This corresponds to [`std::net::TcpStream::connect_timeout`].
#[doc(alias = "connect")]
#[inline]
pub fn connect_timeout_tcp_stream(
&self,
Expand All @@ -170,6 +173,7 @@ impl Pool {
/// Creates a UDP socket from the given address.
///
/// This corresponds to [`std::net::UdpSocket::bind`].
#[doc(alias = "bind")]
#[inline]
pub fn bind_udp_socket<A: ToSocketAddrs>(&self, addr: A) -> io::Result<UdpSocket> {
let addrs = addr.to_socket_addrs()?;
Expand All @@ -192,6 +196,7 @@ impl Pool {
/// number of bytes written.
///
/// This corresponds to [`std::net::UdpSocket::send_to`].
#[doc(alias = "send_to")]
#[inline]
pub fn send_to_udp_socket_addr<A: ToSocketAddrs>(
&self,
Expand All @@ -212,6 +217,7 @@ impl Pool {
/// only receive data from the specified address.
///
/// This corresponds to [`std::net::UdpSocket::connect`].
#[doc(alias = "connect")]
#[inline]
pub fn connect_udp_socket<A: ToSocketAddrs>(
&self,
Expand Down