builder: Add `into_inner` (#299)
When using a `ServiceBuilder`, it's not possible to obtain the underlying `Layer` implementation. Adding a `ServiceBuilder::into_inner` allows callers to retrieve this field instead of only being able to build a `Service`.
This commit is contained in:
parent
18b30eb70e
commit
b39a4881d8
|
@ -212,6 +212,11 @@ impl<L> ServiceBuilder<L> {
|
|||
self.layer(TimeoutLayer::new(timeout))
|
||||
}
|
||||
|
||||
/// Obtains the underlying `Layer` implementation.
|
||||
pub fn into_inner(self) -> L {
|
||||
self.layer
|
||||
}
|
||||
|
||||
/// Wrap the service `S` with the layers.
|
||||
pub fn service<S>(self, service: S) -> L::Service
|
||||
where
|
||||
|
|
Loading…
Reference in New Issue