From c7e0d63bed81f6aa469e0a575d1a03bc0fb1b450 Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Thu, 17 Oct 2019 10:38:25 -0700 Subject: [PATCH] Export the BoxedZebraService type alias. This gives API consumers a convenient name, and makes the Rustdoc output significantly cleaner (because `init` can return a `BoxedZebraService`, not a `Box`. --- zebra-network/src/lib.rs | 2 +- zebra-network/src/peer_set.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/zebra-network/src/lib.rs b/zebra-network/src/lib.rs index 124153c6..e31f0aaf 100644 --- a/zebra-network/src/lib.rs +++ b/zebra-network/src/lib.rs @@ -56,7 +56,7 @@ mod timestamp_collector; pub use config::Config; pub use meta_addr::MetaAddr; pub use network::Network; -pub use peer_set::init; +pub use peer_set::{init, BoxedZebraService}; pub use protocol::internal::{Request, Response}; pub use timestamp_collector::TimestampCollector; diff --git a/zebra-network/src/peer_set.rs b/zebra-network/src/peer_set.rs index 3d34402c..074b698f 100644 --- a/zebra-network/src/peer_set.rs +++ b/zebra-network/src/peer_set.rs @@ -36,7 +36,8 @@ use crate::{ BoxedStdError, }; -type BoxedZebraService = Box< +/// A type alias for a boxed [`tower::Service`] used to process [`Request`]s into [`Response`]s. +pub type BoxedZebraService = Box< dyn Service< Request, Response = Response,