pub trait BoxTransportConnect {
// Required methods
fn is_local(&self) -> bool;
fn get_boxed_transport<'a: 'b, 'b>(
&'a self,
) -> Pbf<'b, BoxTransport, TransportError>;
}
Expand description
Connection details for a transport that can be boxed.
This trait is implemented for TransportConnect
implementors that
produce a boxable transport. It can be used to create a boxed transport
without knowing the exact type of the transport.
This trait is separate from TransportConnect`` to hide the associated type in when this trait is a trait object. It is intended to allow creation of several unlike transports or clients at once. E.g. in something like
Vec<&dyn BoxTransportConnect>.
Required Methods§
Sourcefn get_boxed_transport<'a: 'b, 'b>(
&'a self,
) -> Pbf<'b, BoxTransport, TransportError>
fn get_boxed_transport<'a: 'b, 'b>( &'a self, ) -> Pbf<'b, BoxTransport, TransportError>
Connect to a transport, and box it.