Skip to main content

StreamForward

Trait StreamForward 

Source
pub trait StreamForward: StreamSplit + Sized {
    // Required method
    fn forward_local_to_remote<'a, R, W>(
        codec_key: Option<AesKeyType>,
        framing_key: AesKeyType,
        local_reader: Self::ReaderRef<'a>,
        local_writer: Self::WriterRef<'a>,
        remote_reader: R,
        remote_writer: W,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
       where R: AsyncReadExt + Unpin + Send + 'a,
             W: AsyncWriteExt + Unpin + Send + 'a;

    // Provided methods
    fn supports_data_v2() -> bool { ... }
    fn forward_local_to_remote_with_codec<'a, R, W>(
        codec: Option<DataCodec>,
        framing_key: AesKeyType,
        local_reader: Self::ReaderRef<'a>,
        local_writer: Self::WriterRef<'a>,
        remote_reader: R,
        remote_writer: W,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
       where R: AsyncReadExt + Unpin + Send + 'a,
             W: AsyncWriteExt + Unpin + Send + 'a { ... }
}

Required Methods§

Source

fn forward_local_to_remote<'a, R, W>( codec_key: Option<AesKeyType>, framing_key: AesKeyType, local_reader: Self::ReaderRef<'a>, local_writer: Self::WriterRef<'a>, remote_reader: R, remote_writer: W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
where R: AsyncReadExt + Unpin + Send + 'a, W: AsyncWriteExt + Unpin + Send + 'a,

Provided Methods§

Source

fn supports_data_v2() -> bool

Custom transports keep the legacy data format unless they implement the negotiated forwarding method and explicitly advertise support.

Source

fn forward_local_to_remote_with_codec<'a, R, W>( codec: Option<DataCodec>, framing_key: AesKeyType, local_reader: Self::ReaderRef<'a>, local_writer: Self::WriterRef<'a>, remote_reader: R, remote_writer: W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
where R: AsyncReadExt + Unpin + Send + 'a, W: AsyncWriteExt + Unpin + Send + 'a,

Forward using the format explicitly selected in the authenticated setup.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl StreamForward for TcpStreamImpl

Source§

fn supports_data_v2() -> bool

Source§

fn forward_local_to_remote<'a, R, W>( codec_key: Option<AesKeyType>, framing_key: AesKeyType, local_reader: Self::ReaderRef<'a>, local_writer: Self::WriterRef<'a>, remote_reader: R, remote_writer: W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
where R: AsyncReadExt + Unpin + Send + 'a, W: AsyncWriteExt + Unpin + Send + 'a,

Source§

fn forward_local_to_remote_with_codec<'a, R, W>( codec_key: Option<DataCodec>, framing_key: AesKeyType, local_reader: Self::ReaderRef<'a>, local_writer: Self::WriterRef<'a>, remote_reader: R, remote_writer: W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
where R: AsyncReadExt + Unpin + Send + 'a, W: AsyncWriteExt + Unpin + Send + 'a,

Source§

impl StreamForward for UdpStreamImpl

Source§

fn supports_data_v2() -> bool

Source§

fn forward_local_to_remote<'a, R, W>( codec_key: Option<AesKeyType>, framing_key: AesKeyType, local_reader: Self::ReaderRef<'a>, local_writer: Self::WriterRef<'a>, remote_reader: R, remote_writer: W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
where R: AsyncReadExt + Unpin + Send + 'a, W: AsyncWriteExt + Unpin + Send + 'a,

Source§

fn forward_local_to_remote_with_codec<'a, R, W>( codec_key: Option<DataCodec>, framing_key: AesKeyType, local_reader: Self::ReaderRef<'a>, local_writer: Self::WriterRef<'a>, remote_reader: R, remote_writer: W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
where R: AsyncReadExt + Unpin + Send + 'a, W: AsyncWriteExt + Unpin + Send + 'a,

Implementors§