Crate tower_async_bridge
source ·Expand description
Tower Async Bridge traits and extensions.
You can make use of this crate in order to:
- Turn a
tower::Serviceinto atower_async::Service(requires theinto_asyncfeature); - Turn a
tower_async::Serviceinto atower::Service; - Use a
tower_async::Layerwithin atowerenvironment (e.g.tower::ServiceBuilder); - Use a
tower::Layerwithin atower_asyncenvironment (e.g.tower_async::ServiceBuilder) (requires theinto_asyncfeature);
Please check the crate’s unit tests and examples to see specifically how to use the crate in order to achieve this.
Furthermore we also urge you to only use this kind of approach for transition purposes and not as a permanent way of life. Best in our opinion is to use one or the other and not to combine the two. But if you do absolutely must use one combined with the other, this crate should allow you to do exactly that.
Structs
- A wrapper around a
tower_layer::Layerthat implementstower_async_layer::Layerand is the type returned by AsyncLayerExt::into_async. - A wrapper around a
tower_service::Servicethat implementstower_async_service::Service. - A wrapper around a
tower_layer::Layerthat implementstower_async_layer::Layerand is the type returned by ClassicLayerExt::into_classic. - Service returned by crate::ClassicServiceExt::into_classic.
Traits
- AsyncLayerExt adds a method to any
tower_layer::Layerthat wraps it in an AsyncLayer so that it can be used within atower_async_layer::Layerenvironment. - Extension for a
tower::Serviceto turn it into an asyncService. - ClassicLayerExt adds a method to any
tower_async_layer::Layerthat wraps it in a ClassicLayer so that it can be used within atower_layer::Layerenvironment. - Extension trait for
tower::Servicethat provides the ClassicServiceExt::into_classic method.