GithubHelp home page GithubHelp logo

monoio-gateway's Introduction

Monoio Gateway

A high performance gateway based on Monoio.

Installation

# clone this repo
git clone https://github.com/monoio-rs/monoio-gateway.git
# change work dir to executable crate
cd monoio-gateway/monoio-gateway
# install gateway to system wide
cargo install --path .

Basic Usage

monoio-gateway --config path/to/config.json

Configuration

The configuration of monoio-gateway is formed by a json file.

Configuration Option

Base

field type description required
server_name String server domain true
listen_port [u16] port to bind, usually [80, 443] true
rules [Rules] proxy pass rules true
tls TlsConfig configuration for tls or acme false

Rules

field type description required
path String request path started with '/' true
proxy_pass String endpoint url true

TlsConfig

field type description required
mail String email used to request SSL certificate(acme) false
chain String pem file chained with root ca and server cert false
private_key String pkcs8 encoded private key(start with -----BEGIN PRIVATE KEY-----) false

Note: If defined TlsConfig, which means the server can also be served as https. Users should ensure one of the following parameters exist in TlsConfig, or monoio-gateway will fail to start:

  • mail
    • if defined mail, the gateway will automatically request acme service (Let's Encrypt) to get a free certificate, download and deploy to runtime if there's no valid certificate. Users should ensure the corresponding dns record is pointed to current server.
  • chain, private_key
    • the gateway will use certificates provided in config file, disable acme service for this server_name. mail will be ignored and nullable.

Example

an example configuration is shown below.

{
  "configs": [
    {
      "server_name": "gateway.monoio.rs",
      "listen_port": [80, 443],
      "rules": [
        {
          "path": "/",
          "proxy_pass": {
            "uri": "https://www.google.com"
          }
        },
        {
          "path": "/apple_captive",
          "proxy_pass": {
            "uri": "http://captive.apple.com"
          }
        }
      ],
      "tls": {
        "mail": "[email protected]"
      }
    }
  ]
}

monoio-gateway's People

Contributors

kingtous avatar rainj-me avatar

Stargazers

Basel Ajarmah avatar Sai Marpaka avatar mikione avatar chen quan avatar  avatar Zhaopinglu avatar Astro Xu avatar  avatar λ avatar 陈浩 Nineteen avatar houseme avatar  avatar georgetree avatar 傅长路 avatar marseille avatar  avatar wj avatar  avatar  avatar  avatar Seirios avatar Eden avatar  avatar  avatar Zhang Kaizhao avatar xg avatar 祀画 avatar Aki avatar LIU JIE avatar ihc童鞋@提不起劲 avatar

Watchers

ihc童鞋@提不起劲 avatar John Xu avatar

monoio-gateway's Issues

这个项目还在维护吗?

对这个项目感兴趣,内部有需求。但是自行升级了相关monoio版本后,发现无法正常编译。有相关文档供学习吗

您好,麻烦帮忙看下是不是哪些包没有上传?

项目运行不起来。。

   Compiling monoio-gateway-services v0.1.1 (/Users/zouhuigang/workspaces/monoio-gateway/monoio-gateway-services)
error[E0277]: the trait bound `monoio::net::TcpStream: monoio::io::async_read_rent::AsyncReadRent` is not satisfied
  --> monoio-gateway-services/src/layer/endpoint.rs:74:74
   |
74 | ...                   match tls_connector.connect(server_name, stream).await {
   |                                           -------              ^^^^^^ the trait `monoio::io::async_read_rent::AsyncReadRent` is not implemented for `monoio::net::TcpStream`
   |                                           |
   |                                           required by a bound introduced by this call
   |
   = help: the following other types implement trait `monoio::io::async_read_rent::AsyncReadRent`:
             &[u8]
             &mut A
             monoio::io::util::buf_reader::BufReader<R>
             monoio::io::util::buf_writer::BufWriter<W>
             monoio::io::util::prefixed_io::PrefixedReadIo<I, P>
             monoio::io::util::split::OwnedReadHalf<Inner>
             monoio::io::util::split::ReadHalf<'t, Inner>
             monoio::net::tcp::stream::TcpStream
           and 3 others
note: required by a bound in `TlsConnector::connect`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/client.rs:46:13
   |
46 |         IO: AsyncReadRent + AsyncWriteRent,
   |             ^^^^^^^^^^^^^ required by this bound in `TlsConnector::connect`

error[E0277]: the trait bound `monoio::net::TcpStream: monoio::io::async_write_rent::AsyncWriteRent` is not satisfied
  --> monoio-gateway-services/src/layer/endpoint.rs:74:74
   |
74 | ...                   match tls_connector.connect(server_name, stream).await {
   |                                           -------              ^^^^^^ the trait `monoio::io::async_write_rent::AsyncWriteRent` is not implemented for `monoio::net::TcpStream`
   |                                           |
   |                                           required by a bound introduced by this call
   |
   = help: the following other types implement trait `monoio::io::async_write_rent::AsyncWriteRent`:
             &mut A
             monoio::io::util::buf_reader::BufReader<R>
             monoio::io::util::buf_writer::BufWriter<W>
             monoio::io::util::prefixed_io::PrefixedReadIo<I, P>
             monoio::io::util::split::OwnedWriteHalf<Inner>
             monoio::io::util::split::WriteHalf<'t, Inner>
             monoio::net::tcp::stream::TcpStream
             monoio::net::unix::stream::UnixStream
           and 2 others
note: required by a bound in `TlsConnector::connect`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/client.rs:46:29
   |
46 |         IO: AsyncReadRent + AsyncWriteRent,
   |                             ^^^^^^^^^^^^^^ required by this bound in `TlsConnector::connect`

error[E0277]: the trait bound `monoio::net::TcpStream: monoio::io::async_read_rent::AsyncReadRent` is not satisfied
  --> monoio-gateway-services/src/layer/endpoint.rs:74:39
   |
74 | ...                   match tls_connector.connect(server_name, stream).await {
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `monoio::io::async_read_rent::AsyncReadRent` is not implemented for `monoio::net::TcpStream`
   |
   = help: the following other types implement trait `monoio::io::async_read_rent::AsyncReadRent`:
             &[u8]
             &mut A
             monoio::io::util::buf_reader::BufReader<R>
             monoio::io::util::buf_writer::BufWriter<W>
             monoio::io::util::prefixed_io::PrefixedReadIo<I, P>
             monoio::io::util::split::OwnedReadHalf<Inner>
             monoio::io::util::split::ReadHalf<'t, Inner>
             monoio::net::tcp::stream::TcpStream
           and 3 others
note: required by a bound in `TlsConnector::connect`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/client.rs:46:13
   |
46 |         IO: AsyncReadRent + AsyncWriteRent,
   |             ^^^^^^^^^^^^^ required by this bound in `TlsConnector::connect`

error[E0277]: the trait bound `monoio::net::TcpStream: monoio::io::async_write_rent::AsyncWriteRent` is not satisfied
  --> monoio-gateway-services/src/layer/endpoint.rs:74:39
   |
74 | ...                   match tls_connector.connect(server_name, stream).await {
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `monoio::io::async_write_rent::AsyncWriteRent` is not implemented for `monoio::net::TcpStream`
   |
   = help: the following other types implement trait `monoio::io::async_write_rent::AsyncWriteRent`:
             &mut A
             monoio::io::util::buf_reader::BufReader<R>
             monoio::io::util::buf_writer::BufWriter<W>
             monoio::io::util::prefixed_io::PrefixedReadIo<I, P>
             monoio::io::util::split::OwnedWriteHalf<Inner>
             monoio::io::util::split::WriteHalf<'t, Inner>
             monoio::net::tcp::stream::TcpStream
             monoio::net::unix::stream::UnixStream
           and 2 others
note: required by a bound in `TlsConnector::connect`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/client.rs:46:29
   |
46 |         IO: AsyncReadRent + AsyncWriteRent,
   |                             ^^^^^^^^^^^^^^ required by this bound in `TlsConnector::connect`

error[E0277]: the trait bound `monoio::net::TcpStream: monoio::io::async_read_rent::AsyncReadRent` is not satisfied
  --> monoio-gateway-services/src/layer/endpoint.rs:74:81
   |
74 | ...                   match tls_connector.connect(server_name, stream).await {
   |                                                                       ^^^^^^ the trait `monoio::io::async_read_rent::AsyncReadRent` is not implemented for `monoio::net::TcpStream`
   |
   = help: the following other types implement trait `monoio::io::async_read_rent::AsyncReadRent`:
             &[u8]
             &mut A
             monoio::io::util::buf_reader::BufReader<R>
             monoio::io::util::buf_writer::BufWriter<W>
             monoio::io::util::prefixed_io::PrefixedReadIo<I, P>
             monoio::io::util::split::OwnedReadHalf<Inner>
             monoio::io::util::split::ReadHalf<'t, Inner>
             monoio::net::tcp::stream::TcpStream
           and 3 others
note: required by a bound in `TlsConnector::connect`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/client.rs:46:13
   |
46 |         IO: AsyncReadRent + AsyncWriteRent,
   |             ^^^^^^^^^^^^^ required by this bound in `TlsConnector::connect`

error[E0277]: the trait bound `monoio::net::TcpStream: monoio::io::async_write_rent::AsyncWriteRent` is not satisfied
  --> monoio-gateway-services/src/layer/endpoint.rs:74:81
   |
74 | ...                   match tls_connector.connect(server_name, stream).await {
   |                                                                       ^^^^^^ the trait `monoio::io::async_write_rent::AsyncWriteRent` is not implemented for `monoio::net::TcpStream`
   |
   = help: the following other types implement trait `monoio::io::async_write_rent::AsyncWriteRent`:
             &mut A
             monoio::io::util::buf_reader::BufReader<R>
             monoio::io::util::buf_writer::BufWriter<W>
             monoio::io::util::prefixed_io::PrefixedReadIo<I, P>
             monoio::io::util::split::OwnedWriteHalf<Inner>
             monoio::io::util::split::WriteHalf<'t, Inner>
             monoio::net::tcp::stream::TcpStream
             monoio::net::unix::stream::UnixStream
           and 2 others
note: required by a bound in `TlsConnector::connect`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/client.rs:46:29
   |
46 |         IO: AsyncReadRent + AsyncWriteRent,
   |                             ^^^^^^^^^^^^^^ required by this bound in `TlsConnector::connect`

error[E0277]: the trait bound `monoio_rustls::split::ReadHalf<monoio::net::TcpStream, ClientConnection>: AsyncReadRent` is not satisfied
   --> monoio-gateway-services/src/layer/router.rs:441:56
    |
441 | ...                   _ = copy_response_lock(i.clone(), local_encoder_clone, proxy_pass_domain.clone()) => {}
    |                           ------------------ ^^^^^^^^^ the trait `AsyncReadRent` is not implemented for `monoio_rustls::split::ReadHalf<monoio::net::TcpStream, ClientConnection>`
    |                           |
    |                           required by a bound introduced by this call
    |
    = help: the following other types implement trait `AsyncReadRent`:
              &[u8]
              &mut A
              PrefixedReadIo<I, P>
              ReadHalf<'t, Inner>
              monoio::io::BufReader<R>
              monoio::io::BufWriter<W>
              monoio::io::OwnedReadHalf<Inner>
              monoio::net::TcpStream
            and 2 others
    = note: required for `GenericDecoder<ReadHalf<TcpStream, ClientConnection>, GenericHeadDecoder<Response<Payload>, ...>>` to implement `monoio::io::stream::Stream`
    = note: the full type name has been written to '/Users/zouhuigang/workspaces/monoio-gateway/target/release/deps/monoio_gateway_services-7ea1af4c544e28a3.long-type-17208342870935647506.txt'
note: required by a bound in `copy_response_lock`
   --> /Users/zouhuigang/workspaces/monoio-gateway/monoio-gateway-core/src/transfer/mod.rs:149:11
    |
149 |     Read: Stream<Item = Result<Response<Payload>, DecodeError>> + FillPayload,
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `copy_response_lock`

error[E0277]: the trait bound `monoio_rustls::split::ReadHalf<monoio::net::TcpStream, ClientConnection>: AsyncReadRent` is not satisfied
   --> monoio-gateway-services/src/layer/router.rs:441:37
    |
441 | ...                   _ = copy_response_lock(i.clone(), local_encoder_clone, proxy_pass_domain.clone()) => {}
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncReadRent` is not implemented for `monoio_rustls::split::ReadHalf<monoio::net::TcpStream, ClientConnection>`
    |
    = help: the following other types implement trait `AsyncReadRent`:
              &[u8]
              &mut A
              PrefixedReadIo<I, P>
              ReadHalf<'t, Inner>
              monoio::io::BufReader<R>
              monoio::io::BufWriter<W>
              monoio::io::OwnedReadHalf<Inner>
              monoio::net::TcpStream
            and 2 others
    = note: required for `GenericDecoder<ReadHalf<TcpStream, ClientConnection>, GenericHeadDecoder<Response<Payload>, ...>>` to implement `monoio::io::stream::Stream`
    = note: the full type name has been written to '/Users/zouhuigang/workspaces/monoio-gateway/target/release/deps/monoio_gateway_services-7ea1af4c544e28a3.long-type-17208342870935647506.txt'
note: required by a bound in `copy_response_lock`
   --> /Users/zouhuigang/workspaces/monoio-gateway/monoio-gateway-core/src/transfer/mod.rs:149:11
    |
149 |     Read: Stream<Item = Result<Response<Payload>, DecodeError>> + FillPayload,
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `copy_response_lock`

error[E0277]: the trait bound `monoio_rustls::split::ReadHalf<monoio::net::TcpStream, ClientConnection>: AsyncReadRent` is not satisfied
   --> monoio-gateway-services/src/layer/router.rs:440:29
    |
440 | / ...                   monoio::select! {
441 | | ...                       _ = copy_response_lock(i.clone(), local_encoder_clone, proxy_pass_domain.clone()) => {}
442 | | ...                       _ = rx_clone.recv() => {
443 | | ...                           log::info!("client exit, now cancelling endpoint connection");
...   |
448 | | ...                       }
449 | | ...                   };
    | |_______________________^ the trait `AsyncReadRent` is not implemented for `monoio_rustls::split::ReadHalf<monoio::net::TcpStream, ClientConnection>`
    |
    = help: the following other types implement trait `AsyncReadRent`:
              &[u8]
              &mut A
              PrefixedReadIo<I, P>
              ReadHalf<'t, Inner>
              monoio::io::BufReader<R>
              monoio::io::BufWriter<W>
              monoio::io::OwnedReadHalf<Inner>
              monoio::net::TcpStream
            and 2 others
    = note: required for `GenericDecoder<ReadHalf<TcpStream, ClientConnection>, GenericHeadDecoder<Response<Payload>, ...>>` to implement `monoio::io::stream::Stream`
    = note: the full type name has been written to '/Users/zouhuigang/workspaces/monoio-gateway/target/release/deps/monoio_gateway_services-7ea1af4c544e28a3.long-type-17208342870935647506.txt'
note: required by a bound in `copy_response_lock`
   --> /Users/zouhuigang/workspaces/monoio-gateway/monoio-gateway-core/src/transfer/mod.rs:149:11
    |
149 |     Read: Stream<Item = Result<Response<Payload>, DecodeError>> + FillPayload,
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `copy_response_lock`
    = note: this error originates in the macro `$crate::select` which comes from the expansion of the macro `monoio::select` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the method `send_and_flush` exists for mutable reference `&mut GenericEncoder<WriteHalf<TcpStream, ClientConnection>>`, but its trait bounds were not satisfied
   --> monoio-gateway-services/src/layer/router.rs:481:36
    |
481 |                     let _ = sender.send_and_flush(request).await;
    |                                    ^^^^^^^^^^^^^^ method cannot be called due to unsatisfied trait bounds
    |
   ::: /Users/zouhuigang/workspaces/monoio-http/monoio-http/src/h1/codec/encoder.rs:190:1
    |
190 | pub struct GenericEncoder<T> {
    | ----------------------------
    | |
    | doesn't satisfy `_: Sink<_>`
    | doesn't satisfy `_: SinkExt<_>`
    |
    = note: the following trait bounds were not satisfied:
            `GenericEncoder<monoio_rustls::split::WriteHalf<monoio::net::TcpStream, ClientConnection>>: monoio::io::sink::Sink<_>`
            which is required by `GenericEncoder<monoio_rustls::split::WriteHalf<monoio::net::TcpStream, ClientConnection>>: SinkExt<_>`
            `&mut GenericEncoder<monoio_rustls::split::WriteHalf<monoio::net::TcpStream, ClientConnection>>: monoio::io::sink::Sink<_>`
            which is required by `&mut GenericEncoder<monoio_rustls::split::WriteHalf<monoio::net::TcpStream, ClientConnection>>: SinkExt<_>`

error[E0599]: the method `next` exists for struct `GenericDecoder<ReadHalf<S, ServerConnection>, GenericHeadDecoder<Request<Payload>, RequestHeadDecoder>>`, but its trait bounds were not satisfied
   --> monoio-gateway-services/src/layer/router.rs:195:37
    |
195 |                 match local_decoder.next().await {
    |                                     ^^^^ method cannot be called due to unsatisfied trait bounds
    |
   ::: /Users/zouhuigang/workspaces/monoio-http/monoio-http/src/h1/codec/decoder.rs:380:1
    |
380 | pub struct GenericDecoder<IO, HD> {
    | --------------------------------- doesn't satisfy `_: Stream`
    |
   ::: /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/split.rs:24:1
    |
24  | pub struct ReadHalf<IO, C> {
    | -------------------------- doesn't satisfy `_: AsyncReadRent`
    |
    = note: the following trait bounds were not satisfied:
            `monoio_rustls::split::ReadHalf<S, ServerConnection>: AsyncReadRent`
            which is required by `GenericDecoder<monoio_rustls::split::ReadHalf<S, ServerConnection>, GenericHeadDecoder<http::Request<monoio_http::h1::payload::Payload>, RequestHeadDecoder>>: monoio::io::stream::Stream`

error[E0277]: the trait bound `monoio_rustls::split::WriteHalf<S, ServerConnection>: AsyncWriteRent` is not satisfied
   --> monoio-gateway-services/src/layer/router.rs:212:49
    |
209 | ...                   handle_endpoint_connection(
    |                       -------------------------- required by a bound introduced by this call
...
212 | ...                       local_encoder.clone(),
    |                           ^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncWriteRent` is not implemented for `monoio_rustls::split::WriteHalf<S, ServerConnection>`
    |
    = help: the following other types implement trait `AsyncWriteRent`:
              &mut A
              PrefixedReadIo<I, P>
              WriteHalf<'t, Inner>
              monoio::io::BufReader<R>
              monoio::io::BufWriter<W>
              monoio::io::OwnedWriteHalf<Inner>
              monoio::net::TcpStream
              monoio::net::UnixStream
              monoio_http::util::split::OwnedWriteHalf<IO>
note: required by a bound in `handle_endpoint_connection`
   --> monoio-gateway-services/src/layer/router.rs:393:8
    |
386 | async fn handle_endpoint_connection<O>(
    |          -------------------------- required by a bound in this
...
393 |     O: AsyncWriteRent + 'static,
    |        ^^^^^^^^^^^^^^ required by this bound in `handle_endpoint_connection`

error[E0277]: the trait bound `monoio_rustls::split::WriteHalf<S, ServerConnection>: AsyncWriteRent` is not satisfied
   --> monoio-gateway-services/src/layer/router.rs:224:53
    |
221 | ...                   .handle_acme_verification(
    |                        ------------------------ required by a bound introduced by this call
...
224 | ...                       local_encoder.clone(),
    |                           ^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncWriteRent` is not implemented for `monoio_rustls::split::WriteHalf<S, ServerConnection>`
    |
    = help: the following other types implement trait `AsyncWriteRent`:
              &mut A
              PrefixedReadIo<I, P>
              WriteHalf<'t, Inner>
              monoio::io::BufReader<R>
              monoio::io::BufWriter<W>
              monoio::io::OwnedWriteHalf<Inner>
              monoio::net::TcpStream
              monoio::net::UnixStream
              monoio_http::util::split::OwnedWriteHalf<IO>
    = note: required for `GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>` to implement `monoio::io::sink::Sink<http::Response<monoio_http::h1::payload::Payload>>`
note: required by a bound in `RouterService::<A, I, O>::handle_acme_verification`
   --> monoio-gateway-services/src/layer/router.rs:295:43
    |
295 |     async fn handle_acme_verification<IO: Sink<Response>>(
    |                                           ^^^^^^^^^^^^^^ required by this bound in `RouterService::<A, I, O>::handle_acme_verification`

error[E0599]: the method `send_and_flush` exists for mutable reference `&mut GenericEncoder<WriteHalf<S, ServerConnection>>`, but its trait bounds were not satisfied
   --> monoio-gateway-services/src/layer/router.rs:236:67
    |
236 | ...                   let _ = local_encoder.send_and_flush(
    |                                             ^^^^^^^^^^^^^^ method cannot be called due to unsatisfied trait bounds
    |
   ::: /Users/zouhuigang/workspaces/monoio-http/monoio-http/src/h1/codec/encoder.rs:190:1
    |
190 | pub struct GenericEncoder<T> {
    | ----------------------------
    | |
    | doesn't satisfy `_: Sink<_>`
    | doesn't satisfy `_: SinkExt<_>`
    |
    = note: the following trait bounds were not satisfied:
            `GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: monoio::io::sink::Sink<_>`
            which is required by `GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: SinkExt<_>`
            `&mut GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: monoio::io::sink::Sink<_>`
            which is required by `&mut GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: SinkExt<_>`

error[E0599]: the method `send_and_flush` exists for mutable reference `&mut GenericEncoder<WriteHalf<S, ServerConnection>>`, but its trait bounds were not satisfied
   --> monoio-gateway-services/src/layer/router.rs:244:63
    |
244 | ...                   let _ = local_encoder.send_and_flush(generate_response(
    |                                             ^^^^^^^^^^^^^^ method cannot be called due to unsatisfied trait bounds
    |
   ::: /Users/zouhuigang/workspaces/monoio-http/monoio-http/src/h1/codec/encoder.rs:190:1
    |
190 | pub struct GenericEncoder<T> {
    | ----------------------------
    | |
    | doesn't satisfy `_: Sink<_>`
    | doesn't satisfy `_: SinkExt<_>`
    |
    = note: the following trait bounds were not satisfied:
            `GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: monoio::io::sink::Sink<_>`
            which is required by `GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: SinkExt<_>`
            `&mut GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: monoio::io::sink::Sink<_>`
            which is required by `&mut GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: SinkExt<_>`

error[E0599]: the method `send_and_flush` exists for mutable reference `&mut GenericEncoder<WriteHalf<S, ServerConnection>>`, but its trait bounds were not satisfied
   --> monoio-gateway-services/src/layer/router.rs:254:38
    |
254 | ...                   .send_and_flush(generate_response(StatusCode::FORBIDDEN));
    |                        ^^^^^^^^^^^^^^ method cannot be called due to unsatisfied trait bounds
    |
   ::: /Users/zouhuigang/workspaces/monoio-http/monoio-http/src/h1/codec/encoder.rs:190:1
    |
190 | pub struct GenericEncoder<T> {
    | ----------------------------
    | |
    | doesn't satisfy `_: Sink<_>`
    | doesn't satisfy `_: SinkExt<_>`
    |
    = note: the following trait bounds were not satisfied:
            `GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: monoio::io::sink::Sink<_>`
            which is required by `GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: SinkExt<_>`
            `&mut GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: monoio::io::sink::Sink<_>`
            which is required by `&mut GenericEncoder<monoio_rustls::split::WriteHalf<S, ServerConnection>>: SinkExt<_>`

error[E0277]: the trait bound `S: monoio::io::async_read_rent::AsyncReadRent` is not satisfied
  --> monoio-gateway-services/src/layer/tls.rs:69:39
   |
69 |             match tls_acceptor.accept(accept.0).await {
   |                                ------ ^^^^^^^^ the trait `monoio::io::async_read_rent::AsyncReadRent` is not implemented for `S`
   |                                |
   |                                required by a bound introduced by this call
   |
note: required by a bound in `TlsAcceptor::accept`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/server.rs:42:13
   |
42 |         IO: AsyncReadRent + AsyncWriteRent,
   |             ^^^^^^^^^^^^^ required by this bound in `TlsAcceptor::accept`
help: consider further restricting this bound
   |
40 |     S: Split + AsyncReadRent + AsyncWriteRent + 'static + monoio::io::async_read_rent::AsyncReadRent,
   |                                                         ++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `S: monoio::io::async_write_rent::AsyncWriteRent` is not satisfied
  --> monoio-gateway-services/src/layer/tls.rs:69:39
   |
69 |             match tls_acceptor.accept(accept.0).await {
   |                                ------ ^^^^^^^^ the trait `monoio::io::async_write_rent::AsyncWriteRent` is not implemented for `S`
   |                                |
   |                                required by a bound introduced by this call
   |
note: required by a bound in `TlsAcceptor::accept`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/server.rs:42:29
   |
42 |         IO: AsyncReadRent + AsyncWriteRent,
   |                             ^^^^^^^^^^^^^^ required by this bound in `TlsAcceptor::accept`
help: consider further restricting this bound
   |
40 |     S: Split + AsyncReadRent + AsyncWriteRent + 'static + monoio::io::async_write_rent::AsyncWriteRent,
   |                                                         ++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `S: monoio::io::async_read_rent::AsyncReadRent` is not satisfied
  --> monoio-gateway-services/src/layer/tls.rs:69:19
   |
69 |             match tls_acceptor.accept(accept.0).await {
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `monoio::io::async_read_rent::AsyncReadRent` is not implemented for `S`
   |
note: required by a bound in `TlsAcceptor::accept`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/server.rs:42:13
   |
42 |         IO: AsyncReadRent + AsyncWriteRent,
   |             ^^^^^^^^^^^^^ required by this bound in `TlsAcceptor::accept`
help: consider further restricting this bound
   |
40 |     S: Split + AsyncReadRent + AsyncWriteRent + 'static + monoio::io::async_read_rent::AsyncReadRent,
   |                                                         ++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `S: monoio::io::async_write_rent::AsyncWriteRent` is not satisfied
  --> monoio-gateway-services/src/layer/tls.rs:69:19
   |
69 |             match tls_acceptor.accept(accept.0).await {
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `monoio::io::async_write_rent::AsyncWriteRent` is not implemented for `S`
   |
note: required by a bound in `TlsAcceptor::accept`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/server.rs:42:29
   |
42 |         IO: AsyncReadRent + AsyncWriteRent,
   |                             ^^^^^^^^^^^^^^ required by this bound in `TlsAcceptor::accept`
help: consider further restricting this bound
   |
40 |     S: Split + AsyncReadRent + AsyncWriteRent + 'static + monoio::io::async_write_rent::AsyncWriteRent,
   |                                                         ++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `S: monoio::io::async_read_rent::AsyncReadRent` is not satisfied
  --> monoio-gateway-services/src/layer/tls.rs:69:48
   |
69 |             match tls_acceptor.accept(accept.0).await {
   |                                                ^^^^^^ the trait `monoio::io::async_read_rent::AsyncReadRent` is not implemented for `S`
   |
note: required by a bound in `TlsAcceptor::accept`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/server.rs:42:13
   |
42 |         IO: AsyncReadRent + AsyncWriteRent,
   |             ^^^^^^^^^^^^^ required by this bound in `TlsAcceptor::accept`
help: consider further restricting this bound
   |
40 |     S: Split + AsyncReadRent + AsyncWriteRent + 'static + monoio::io::async_read_rent::AsyncReadRent,
   |                                                         ++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `S: monoio::io::async_write_rent::AsyncWriteRent` is not satisfied
  --> monoio-gateway-services/src/layer/tls.rs:69:48
   |
69 |             match tls_acceptor.accept(accept.0).await {
   |                                                ^^^^^^ the trait `monoio::io::async_write_rent::AsyncWriteRent` is not implemented for `S`
   |
note: required by a bound in `TlsAcceptor::accept`
  --> /Users/zouhuigang/workspaces/monoio-tls/monoio-rustls/src/server.rs:42:29
   |
42 |         IO: AsyncReadRent + AsyncWriteRent,
   |                             ^^^^^^^^^^^^^^ required by this bound in `TlsAcceptor::accept`
help: consider further restricting this bound
   |
40 |     S: Split + AsyncReadRent + AsyncWriteRent + 'static + monoio::io::async_write_rent::AsyncWriteRent,
   |                                                         ++++++++++++++++++++++++++++++++++++++++++++++

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.