/// Inner rsa data for encrypted stream read+write halves
structEncryptedStreamMeta
{
@ -42,20 +51,55 @@ struct ReadWriteCombined<R, W>
}
/// RSA/chacha20 encrypted stream
pubstructEncryptedStream<S>
whereS: AsyncStream
pubstructEncryptedStream<R,W>
whereR: AsyncRead,
W: AsyncWrite,
{
meta: EncryptedStreamMeta,
// Keep the streams on the heap to keep this type not hueg.
backing: Box<ReadWriteCombined<S,S>>,
backing: Box<ReadWriteCombined<R,W>>,
}
impl<S: AsyncStream>EncryptedStream<S>
//TODO: How do we use this with a single AsyncStream instead of requiring 2? Will we need to make our own Arc wrapper?? Ugh,, for now let's ignore this I guess... Most read+write thingies have a Read/WriteHalf split mechanism.