diff --git a/lychee-lib/src/chain/mod.rs b/lychee-lib/src/chain/mod.rs index 59ea75c..bdf52a2 100644 --- a/lychee-lib/src/chain/mod.rs +++ b/lychee-lib/src/chain/mod.rs @@ -87,7 +87,7 @@ impl Chain { pub(crate) async fn traverse(&self, mut input: T) -> ChainResult { use ChainResult::{Done, Next}; for e in self.0.lock().await.iter_mut() { - match e.chain(input).await { + match e.handle(input).await { Next(r) => input = r, Done(r) => { return Done(r); @@ -131,7 +131,7 @@ pub trait Handler: Debug { /// /// #[async_trait] /// impl Handler for AddHeader { - /// async fn chain(&mut self, mut request: Request) -> ChainResult { + /// async fn handle(&mut self, mut request: Request) -> ChainResult { /// // You can modify the request however you like here /// request.headers_mut().append("X-Header", "value".parse().unwrap()); /// @@ -140,7 +140,7 @@ pub trait Handler: Debug { /// } /// } /// ``` - async fn chain(&mut self, input: T) -> ChainResult; + async fn handle(&mut self, input: T) -> ChainResult; } /// Client request chains @@ -195,7 +195,7 @@ mod test { #[async_trait] impl Handler for Add { - async fn chain(&mut self, req: Result) -> ChainResult { + async fn handle(&mut self, req: Result) -> ChainResult { let added = req.0 + self.0; if added > 100 { Done(Result(req.0)) diff --git a/lychee-lib/src/checker.rs b/lychee-lib/src/checker.rs index ba89c1c..428551a 100644 --- a/lychee-lib/src/checker.rs +++ b/lychee-lib/src/checker.rs @@ -74,7 +74,7 @@ fn clone_unwrap(request: &Request) -> Request { #[async_trait] impl Handler for Checker { - async fn chain(&mut self, input: Request) -> ChainResult { + async fn handle(&mut self, input: Request) -> ChainResult { ChainResult::Done(self.retry_request(input).await) } } diff --git a/lychee-lib/src/client.rs b/lychee-lib/src/client.rs index 15f9397..0bc1fd0 100644 --- a/lychee-lib/src/client.rs +++ b/lychee-lib/src/client.rs @@ -1087,7 +1087,7 @@ mod tests { #[async_trait] impl Handler for ExampleHandler { - async fn chain(&mut self, _: Request) -> ChainResult { + async fn handle(&mut self, _: Request) -> ChainResult { ChainResult::Done(Status::Excluded) } } diff --git a/lychee-lib/src/quirks/mod.rs b/lychee-lib/src/quirks/mod.rs index 69976fc..39af651 100644 --- a/lychee-lib/src/quirks/mod.rs +++ b/lychee-lib/src/quirks/mod.rs @@ -93,7 +93,7 @@ impl Quirks { #[async_trait] impl Handler for Quirks { - async fn chain(&mut self, input: Request) -> ChainResult { + async fn handle(&mut self, input: Request) -> ChainResult { ChainResult::Next(self.apply(input)) } } diff --git a/lychee-lib/src/types/basic_auth/credentials.rs b/lychee-lib/src/types/basic_auth/credentials.rs index 74a4531..1af0144 100644 --- a/lychee-lib/src/types/basic_auth/credentials.rs +++ b/lychee-lib/src/types/basic_auth/credentials.rs @@ -76,7 +76,7 @@ impl BasicAuthCredentials { #[async_trait] impl Handler for Option { - async fn chain(&mut self, mut request: Request) -> ChainResult { + async fn handle(&mut self, mut request: Request) -> ChainResult { if let Some(credentials) = self { request .headers_mut()