pub trait TransportConnect:
Sized
+ Send
+ Sync
+ 'static {
type Transport: Transport + Clone;
// Required methods
fn is_local(&self) -> bool;
fn get_transport<'a: 'b, 'b>(
&'a self,
) -> Pbf<'b, Self::Transport, TransportError>;
}
Expand description
Connection details for a transport.
This object captures the information necessary to establish a transport, and may encapsulate reconnection logic.
§Why implement TransportConnect
?
Users may want to implement transport-connect for the following reasons:
- You want to customize a
reqwest::Client
before using it. - You need to provide special authentication information to a remote provider.
- You have implemented a custom
Transport
. - You require a specific websocket reconnection strategy.
Required Associated Types§
Required Methods§
Sourcefn get_transport<'a: 'b, 'b>(
&'a self,
) -> Pbf<'b, Self::Transport, TransportError>
fn get_transport<'a: 'b, 'b>( &'a self, ) -> Pbf<'b, Self::Transport, TransportError>
Connect to the transport, returning a Transport
instance.
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.