use super::*;
pub struct BootstrapTcpServer<W> {
bootstrap_tcp: BootstrapTcp<W>,
}
impl<W: 'static> Default for BootstrapTcpServer<W> {
fn default() -> Self {
Self::new()
}
}
impl<W: 'static> BootstrapTcpServer<W> {
pub fn new() -> Self {
Self {
bootstrap_tcp: BootstrapTcp::new(),
}
}
pub fn pipeline(
&mut self,
pipeline_factory_fn: PipelineFactoryFn<TaggedBytesMut, W>,
) -> &mut Self {
self.bootstrap_tcp.pipeline(pipeline_factory_fn);
self
}
pub async fn bind<A: AsyncToSocketAddrs>(&self, addr: A) -> Result<SocketAddr, Error> {
self.bootstrap_tcp.bind(addr).await
}
pub async fn stop(&self) {
self.bootstrap_tcp.stop().await
}
pub async fn wait_for_stop(&self) {
self.bootstrap_tcp.wait_for_stop().await
}
pub async fn graceful_stop(&self) {
self.bootstrap_tcp.graceful_stop().await
}
}