alloy_transport

Trait TransportConnect

Source
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§

Source

type Transport: Transport + Clone

The transport type that is returned by connect.

Required Methods§

Source

fn is_local(&self) -> bool

Returns true if the transport connects to a local resource.

Source

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.

Implementors§