docs(server): set doc_cfg attributes for tcp feature gated Server methods (#2401)

This commit is contained in:
nickelc
2021-01-14 22:56:49 +01:00
committed by GitHub
parent f0ddb66932
commit 257d6a9919

View File

@@ -52,7 +52,9 @@ impl<I> Server<I, ()> {
} }
} }
#[cfg(feature = "tcp")] cfg_feature! {
#![all(feature = "tcp")]
impl Server<AddrIncoming, ()> { impl Server<AddrIncoming, ()> {
/// Binds to the provided address, and returns a [`Builder`](Builder). /// Binds to the provided address, and returns a [`Builder`](Builder).
/// ///
@@ -77,14 +79,18 @@ impl Server<AddrIncoming, ()> {
AddrIncoming::from_std(listener).map(Server::builder) AddrIncoming::from_std(listener).map(Server::builder)
} }
} }
}
cfg_feature! {
#![all(feature = "tcp")]
#[cfg(feature = "tcp")]
impl<S, E> Server<AddrIncoming, S, E> { impl<S, E> Server<AddrIncoming, S, E> {
/// Returns the local address that this server is bound to. /// Returns the local address that this server is bound to.
pub fn local_addr(&self) -> SocketAddr { pub fn local_addr(&self) -> SocketAddr {
self.spawn_all.local_addr() self.spawn_all.local_addr()
} }
} }
}
impl<I, IO, IE, S, E, B> Server<I, S, E> impl<I, IO, IE, S, E, B> Server<I, S, E>
where where