File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ use std::future::Future;
4848
4949use crate :: layer:: util:: Identity ;
5050
51+ #[ cfg( feature = "buffer" ) ]
52+ use crate :: buffer:: Buffer ;
53+
5154pub mod error {
5255 //! Error types
5356
@@ -944,6 +947,20 @@ pub trait ServiceExt<Request>: tower_service::Service<Request> {
944947 MapFuture :: new ( self , f)
945948 }
946949
950+ /// Returns a buffered version of this service.
951+ ///
952+ /// See [`Buffer::new()`] for the details.
953+ #[ cfg( feature = "buffer" ) ]
954+ fn buffered ( self , bound : usize ) -> Buffer < Request , Self :: Future >
955+ where
956+ Self : Send + Sized + ' static ,
957+ Self :: Future : Send ,
958+ Self :: Error : Into < crate :: BoxError > + Send + Sync ,
959+ Request : Send + Sized + ' static ,
960+ {
961+ Buffer :: new ( self , bound)
962+ }
963+
947964 /// Convert the service into a [`Service`] + [`Send`] trait object.
948965 ///
949966 /// See [`BoxService`] for more details.
You can’t perform that action at this time.
0 commit comments