Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn committed Dec 5, 2023
1 parent 365c047 commit 63a8ea2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions crates/core/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use crate::http::StatusCode;
use crate::{async_trait, Depot, FlowCtrl, Request, Response};

/// Handler
///
///
/// `Handler` is used for handle [`Request`]. View [module level documentation](index.html) for more details.
#[async_trait]
pub trait Handler: Send + Sync + 'static {
Expand Down Expand Up @@ -91,7 +91,7 @@ where
}

/// `Skipper` is used to check if the request should be skipped.
///
///
/// `Skipper` is used in many middlewares.
pub trait Skipper: Send + Sync + 'static {
/// Check if the request should be skipped.
Expand Down
14 changes: 7 additions & 7 deletions crates/core/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ impl ServerHandle {
/// Graceful stop server.
///
/// Call this function will stop server after all connections are closed,
/// allowing it to finish processing any ongoing requests before terminating.
/// allowing it to finish processing any ongoing requests before terminating.
/// It ensures that all connections are closed properly and any resources are released.
///
/// You can specify a timeout to force stop server.
///
/// You can specify a timeout to force stop server.
/// If `timeout` is `None`, it will wait util all connections are closed.
///
/// This function gracefully stop the server, allowing it to finish processing any
Expand All @@ -59,7 +59,7 @@ impl ServerHandle {
/// handle.stop_graceful(None);
/// }
/// ```
///
///
pub fn stop_graceful(&self, timeout: impl Into<Option<Duration>>) {
self.tx_cmd.send(ServerCommand::StopGraceful(timeout.into())).ok();
}
Expand Down Expand Up @@ -138,7 +138,7 @@ impl<A: Acceptor + Send> Server<A> {
/// Graceful stop server.
///
/// Call this function will stop server after all connections are closed.
/// You can specify a timeout to force stop server.
/// You can specify a timeout to force stop server.
/// If `timeout` is `None`, it will wait util all connections are closed.
pub fn stop_graceful(&self, timeout: impl Into<Option<Duration>>) {
self.tx_cmd.send(ServerCommand::StopGraceful(timeout.into())).ok();
Expand Down Expand Up @@ -183,7 +183,7 @@ impl<A: Acceptor + Send> Server<A> {
}

/// Serve a [`Service`].
///
///
/// # Example
///
/// ```no_run
Expand All @@ -193,7 +193,7 @@ impl<A: Acceptor + Send> Server<A> {
/// async fn hello() -> &'static str {
/// "Hello World"
/// }
///
///
/// #[tokio::main]
/// async fn main() {
/// let acceptor = TcpListener::new("0.0.0.0:5800").bind().await;
Expand Down

0 comments on commit 63a8ea2

Please sign in to comment.