pub trait IntoTransportLayer: Sized {
// Required methods
fn into_http_transport_layer(
self,
builder: TransportLayerBuilder,
) -> Result<Box<dyn TransportLayer>>;
fn into_mock_transport_layer(self) -> Result<Box<dyn TransportLayer>>;
// Provided method
fn into_default_transport(
self,
_builder: TransportLayerBuilder,
) -> Result<Box<dyn TransportLayer>> { ... }
}
Expand description
This exists to unify how to send mock or real messages to different services.
This includes differences between Router
,
IntoMakeService
,
and IntoMakeServiceWithConnectInfo
.
Implementing this will allow you to use the TestServer
against other types.
Warning, this trait may change in a future release.
Required Methods§
fn into_http_transport_layer( self, builder: TransportLayerBuilder, ) -> Result<Box<dyn TransportLayer>>
fn into_mock_transport_layer(self) -> Result<Box<dyn TransportLayer>>
Provided Methods§
fn into_default_transport( self, _builder: TransportLayerBuilder, ) -> Result<Box<dyn TransportLayer>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl IntoTransportLayer for Router<()>
impl IntoTransportLayer for Router<()>
fn into_http_transport_layer( self, builder: TransportLayerBuilder, ) -> Result<Box<dyn TransportLayer>>
fn into_mock_transport_layer(self) -> Result<Box<dyn TransportLayer>>
Source§impl IntoTransportLayer for AxumService
Available on crate feature shuttle
only.
impl IntoTransportLayer for AxumService
Available on crate feature
shuttle
only.fn into_http_transport_layer( self, builder: TransportLayerBuilder, ) -> Result<Box<dyn TransportLayer>>
fn into_mock_transport_layer(self) -> Result<Box<dyn TransportLayer>>
Source§impl IntoTransportLayer for ShuttleAxum
Available on crate feature shuttle
only.
impl IntoTransportLayer for ShuttleAxum
Available on crate feature
shuttle
only.