Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
RamziA961 authored Sep 30, 2023
2 parents 48e09e0 + 96d54b1 commit 315c9c8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/server/conn/http1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ type Http1Dispatcher<T, B, S> = proto::h1::Dispatcher<
>;

pin_project_lite::pin_project! {
/// A future binding an http1 connection with a Service.
/// A [`Future`](core::future::Future) representing an HTTP/1 connection, bound to a
/// [`Service`](crate::service::Service), returned from
/// [`Builder::serve_connection`](struct.Builder.html#method.serve_connection).
///
/// Polling this future will drive HTTP forward.
/// To drive HTTP on this connection this future **must be polled**, typically with
/// `.await`. If it isn't polled, no progress will be made on this connection.
#[must_use = "futures do nothing unless polled"]
pub struct Connection<T, S>
where
Expand Down
7 changes: 5 additions & 2 deletions src/server/conn/http2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ use crate::service::HttpService;
use crate::{common::time::Time, rt::Timer};

pin_project! {
/// A future binding an HTTP/2 connection with a Service.
/// A [`Future`](core::future::Future) representing an HTTP/2 connection, bound to a
/// [`Service`](crate::service::Service), returned from
/// [`Builder::serve_connection`](struct.Builder.html#method.serve_connection).
///
/// Polling this future will drive HTTP forward.
/// To drive HTTP on this connection this future **must be polled**, typically with
/// `.await`. If it isn't polled, no progress will be made on this connection.
#[must_use = "futures do nothing unless polled"]
pub struct Connection<T, S, E>
where
Expand Down
10 changes: 8 additions & 2 deletions src/server/conn/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
//! are not handled at this level. This module provides the building blocks to
//! customize those things externally.
//!
//! This module is split by HTTP version. Both work similarly, but do have
//! specific options on each builder.
//! This module is split by HTTP version, providing a connection builder for
//! each. They work similarly, but they each have specific options.
//!
//! If your server needs to support both versions, an auto-connection builder is
//! provided in the [`hyper-util`](https://github.com/hyperium/hyper-util/tree/master)
//! crate. This builder wraps the HTTP/1 and HTTP/2 connection builders from this
//! module, allowing you to set configuration for both. The builder will then check
//! the version of the incoming connection and serve it accordingly.
#[cfg(feature = "http1")]
pub mod http1;
Expand Down
2 changes: 1 addition & 1 deletion src/service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ pub trait Service<Request> {
/// - It's clearer that Services can likely be cloned
/// - To share state across clones you generally need Arc<Mutex<_>>
/// that means you're not really using the &mut self and could do with a &self
/// To see the discussion on this see: https://github.com/hyperium/hyper/issues/3040
/// To see the discussion on this see: <https://github.com/hyperium/hyper/issues/3040>
fn call(&self, req: Request) -> Self::Future;
}

0 comments on commit 315c9c8

Please sign in to comment.