Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async-std TcpStream impls BufRead w/ AsyncWrite #63

Open
pinkforest opened this issue Jul 6, 2024 · 2 comments
Open

async-std TcpStream impls BufRead w/ AsyncWrite #63

pinkforest opened this issue Jul 6, 2024 · 2 comments

Comments

@pinkforest
Copy link

pinkforest commented Jul 6, 2024

eed4f0b

So wrapping TcpStream with BufReader should work ?

Even if I wrap it to BufReader then it wants AsyncWrite too complicating setting stuff like async-native-tls up ?

I could implement my own type with those implemented but probably doc neeeds to be adjusted - it's not as straightforward now in combination with the types it's usually used as the doc points to direct use with TcpStream.

45 |                 let mut transport = SmtpTransport::new(client, reader).await?;                
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncWrite` is not implemented for `std::io::BufReader<TlsStream<async_std::net::TcpStream>>`

Repro: https://github.com/pinkforest/repro-async-std-async-smtp

For now I'm just using 0.8 as but got to refactor and port this stuff over off async-std probably

@pinkforest pinkforest changed the title async-std TcpStream impls BufRead / AsyncBufRead missing ? async-std TcpStream impls BufRead w/ AsyncWrite Jul 6, 2024
@link2xt
Copy link
Collaborator

link2xt commented Jul 8, 2024

Delta Chat uses tokio, but implements a wrapper type there because it also needs to progagate read timeouts over TLS and SOCKS5: https://github.com/deltachat/deltachat-core-rust/blob/a198e9fce84deb777c712a41d370ab8cf11cc240/src/net/session.rs

@link2xt
Copy link
Collaborator

link2xt commented Oct 13, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants