Skip to main content

HostConnectorWithStore

Trait HostConnectorWithStore 

Source
pub trait HostConnectorWithStore<T>: HasData + Send {
    // Required methods
    fn send(
        host: Access<'_, T, Self>,
        self_: Resource<Connector>,
        cleartext: StreamReader<u8>,
    ) -> Result<(StreamReader<u8>, FutureReader<Result<(), Resource<Error>>>)>;
    fn receive(
        host: Access<'_, T, Self>,
        self_: Resource<Connector>,
        ciphertext: StreamReader<u8>,
    ) -> Result<(StreamReader<u8>, FutureReader<Result<(), Resource<Error>>>)>;
    fn connect(
        accessor: &Accessor<T, Self>,
        this: Resource<Connector>,
        server_name: String,
    ) -> impl Future<Output = Result<Result<(), Resource<Error>>>> + Send;
}

Required Methods§

Source

fn send( host: Access<'_, T, Self>, self_: Resource<Connector>, cleartext: StreamReader<u8>, ) -> Result<(StreamReader<u8>, FutureReader<Result<(), Resource<Error>>>)>

Set up the encryption stream transform. This takes an unprotected cleartext application data stream and returns an encrypted data stream, ready to be sent out over the network. Closing the cleartext stream will cause a close_notify packet to be emitted on the returned output stream.

Source

fn receive( host: Access<'_, T, Self>, self_: Resource<Connector>, ciphertext: StreamReader<u8>, ) -> Result<(StreamReader<u8>, FutureReader<Result<(), Resource<Error>>>)>

Set up the decryption stream transform. This takes an encrypted data stream, as received via e.g. the network, and returns a decrypted application data stream.

Source

fn connect( accessor: &Accessor<T, Self>, this: Resource<Connector>, server_name: String, ) -> impl Future<Output = Result<Result<(), Resource<Error>>>> + Send

Perform the handshake. The send & receive streams must be set up before calling this method.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§