Rename TransportHelper => TransportImplHelper.
This commit is contained in:
parent
17ba4a1cc2
commit
acc2de7b31
|
@ -4,7 +4,7 @@ use std::io;
|
|||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use crate::factory::{BootstrapReporter, ChannelFactory};
|
||||
use crate::transport::TransportHelper;
|
||||
use crate::transport::TransportImplHelper;
|
||||
use crate::{event::ChanMgrEventSender, Error};
|
||||
|
||||
use std::time::Duration;
|
||||
|
@ -28,7 +28,7 @@ use futures::task::SpawnExt;
|
|||
///
|
||||
/// This channel builder does not retry on failure, but it _does_ implement a
|
||||
/// time-out.
|
||||
pub struct ChanBuilder<R: Runtime, H: TransportHelper>
|
||||
pub struct ChanBuilder<R: Runtime, H: TransportImplHelper>
|
||||
where
|
||||
R: tor_rtcompat::TlsProvider<H::Stream>,
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ where
|
|||
tls_connector: <R as TlsProvider<H::Stream>>::Connector,
|
||||
}
|
||||
|
||||
impl<R: Runtime, H: TransportHelper> ChanBuilder<R, H>
|
||||
impl<R: Runtime, H: TransportImplHelper> ChanBuilder<R, H>
|
||||
where
|
||||
R: TlsProvider<H::Stream>,
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ where
|
|||
}
|
||||
}
|
||||
#[async_trait]
|
||||
impl<R: Runtime, H: TransportHelper> ChannelFactory for ChanBuilder<R, H>
|
||||
impl<R: Runtime, H: TransportImplHelper> ChannelFactory for ChanBuilder<R, H>
|
||||
where
|
||||
R: tor_rtcompat::TlsProvider<H::Stream> + Send + Sync,
|
||||
H: Send + Sync,
|
||||
|
@ -84,7 +84,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<R: Runtime, H: TransportHelper> ChanBuilder<R, H>
|
||||
impl<R: Runtime, H: TransportImplHelper> ChanBuilder<R, H>
|
||||
where
|
||||
R: tor_rtcompat::TlsProvider<H::Stream> + Send + Sync,
|
||||
H: Send + Sync,
|
||||
|
|
|
@ -34,7 +34,7 @@ impl BootstrapReporter {
|
|||
/// construct all of its channels.
|
||||
///
|
||||
/// A `ChannelFactory` can be implemented in terms of a
|
||||
/// [`TransportHelper`](crate::transport::TransportHelper), by wrapping it in a
|
||||
/// [`TransportImplHelper`](crate::transport::TransportImplHelper), by wrapping it in a
|
||||
/// `ChanBuilder`.
|
||||
///
|
||||
// FIXME(eta): Rectify the below situation.
|
||||
|
|
|
@ -25,14 +25,14 @@ pub use proxied::ProxyError;
|
|||
/// TLS over some stream-like type, and you only want to define the stream-like
|
||||
/// type.
|
||||
///
|
||||
/// To convert a [`TransportHelper`] into a
|
||||
/// To convert a [`TransportImplHelper`] into a
|
||||
/// [`ChannelFactory`](crate::factory::ChannelFactory), wrap it in a
|
||||
/// `ChanBuilder`.
|
||||
//
|
||||
// TODO: Maybe move this to a separate crate so that tor-ptmgr can be
|
||||
// used without having to depend on chanmgr.
|
||||
#[async_trait]
|
||||
pub trait TransportHelper {
|
||||
pub trait TransportImplHelper {
|
||||
/// The type of the resulting stream.
|
||||
type Stream: AsyncRead + AsyncWrite + Send + Sync + 'static;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ impl<R: Runtime> DefaultTransport<R> {
|
|||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<R: Runtime> crate::transport::TransportHelper for DefaultTransport<R> {
|
||||
impl<R: Runtime> crate::transport::TransportImplHelper for DefaultTransport<R> {
|
||||
type Stream = <R as TcpProvider>::TcpStream;
|
||||
|
||||
/// Implements the transport: makes a TCP connection (possibly
|
||||
|
|
|
@ -28,7 +28,7 @@ use tor_socksproto::{
|
|||
};
|
||||
|
||||
#[cfg(feature = "pt-client")]
|
||||
use super::TransportHelper;
|
||||
use super::TransportImplHelper;
|
||||
#[cfg(feature = "pt-client")]
|
||||
use async_trait::async_trait;
|
||||
#[cfg(feature = "pt-client")]
|
||||
|
@ -285,7 +285,7 @@ impl<R: TcpProvider + Send + Sync> ExternalProxyPlugin<R> {
|
|||
|
||||
#[cfg(feature = "pt-client")]
|
||||
#[async_trait]
|
||||
impl<R: TcpProvider + Send + Sync> TransportHelper for ExternalProxyPlugin<R> {
|
||||
impl<R: TcpProvider + Send + Sync> TransportImplHelper for ExternalProxyPlugin<R> {
|
||||
type Stream = R::TcpStream;
|
||||
|
||||
async fn connect(
|
||||
|
|
Loading…
Reference in New Issue