/// Inner rsa data for encrypted stream read+write halves
/// Inner rsa data for encrypted stream read+write halves
structEncryptedStreamMeta
structEncryptedStreamMeta
{
{
@ -42,20 +51,55 @@ struct ReadWriteCombined<R, W>
}
}
/// RSA/chacha20 encrypted stream
/// RSA/chacha20 encrypted stream
pubstructEncryptedStream<S>
pubstructEncryptedStream<R,W>
whereS: AsyncStream
whereR: AsyncRead,
W: AsyncWrite,
{
{
meta: EncryptedStreamMeta,
meta: EncryptedStreamMeta,
// Keep the streams on the heap to keep this type not hueg.
// 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.