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

The tokio-native-tls/examples/echo failed to compile #52

Open
uudiin opened this issue Mar 12, 2021 · 0 comments
Open

The tokio-native-tls/examples/echo failed to compile #52

uudiin opened this issue Mar 12, 2021 · 0 comments

Comments

@uudiin
Copy link

uudiin commented Mar 12, 2021

error[E0277]: the trait bound tokio::net::TcpStream: tokio::io::async_read::AsyncRead is not satisfied
--> src/main.rs:33:54
|
33 | let mut tls_stream = tls_acceptor.accept(socket).await.expect("accept error");
| ^^^^^^ the trait tokio::io::async_read::AsyncRead is not implemented for tokio::net::TcpStream

error[E0277]: the trait bound tokio::net::TcpStream: tokio::io::async_write::AsyncWrite is not satisfied
--> src/main.rs:33:54
|
33 | let mut tls_stream = tls_acceptor.accept(socket).await.expect("accept error");
| ^^^^^^ the trait tokio::io::async_write::AsyncWrite is not implemented for tokio::net::TcpStream

error[E0599]: no method named read found for struct tokio_tls::TlsStream<tokio::net::TcpStream> in the current scope
--> src/main.rs:38:18
|
38 | .read(&mut buf)
| ^^^^ method not found in tokio_tls::TlsStream<tokio::net::TcpStream>
|
::: /Users/tianjia/.cargo/registry/src/mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b/tokio-tls-0.3.1/src/lib.rs:60:1
|
60 | pub struct TlsStream(native_tls::TlsStream<AllowStd>);
| ------------------------------------------------------------
| |
| doesn't satisfy _: AsyncReadExt
| doesn't satisfy _: AsyncRead
|
= note: the method read exists but the following trait bounds were not satisfied:
tokio_tls::TlsStream<tokio::net::TcpStream>: AsyncRead
which is required by tokio_tls::TlsStream<tokio::net::TcpStream>: AsyncReadExt

error[E0599]: no method named write_all found for struct tokio_tls::TlsStream<tokio::net::TcpStream> in the current scope
--> src/main.rs:49:18
|
49 | .write_all(&buf[0..n])
| ^^^^^^^^^ method not found in tokio_tls::TlsStream<tokio::net::TcpStream>
|
::: /Users/tianjia/.cargo/registry/src/mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b/tokio-tls-0.3.1/src/lib.rs:60:1
|
60 | pub struct TlsStream(native_tls::TlsStream<AllowStd>);
| ------------------------------------------------------------
| |
| doesn't satisfy _: AsyncWriteExt
| doesn't satisfy _: AsyncWrite
|
= note: the method write_all exists but the following trait bounds were not satisfied:
tokio_tls::TlsStream<tokio::net::TcpStream>: AsyncWrite
which is required by tokio_tls::TlsStream<tokio::net::TcpStream>: AsyncWriteExt

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

1 participant