From 6ef2e96842ed9288587b4b026af6a6b33454122a Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Thu, 31 Oct 2019 15:50:36 +0600 Subject: [PATCH] Add comments (error_policy.rs) --- src/dispatching/dispatchers/filter/error_policy.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dispatching/dispatchers/filter/error_policy.rs b/src/dispatching/dispatchers/filter/error_policy.rs index 0f4af1d0..d80e2389 100644 --- a/src/dispatching/dispatchers/filter/error_policy.rs +++ b/src/dispatching/dispatchers/filter/error_policy.rs @@ -2,6 +2,7 @@ use std::future::Future; use async_trait::async_trait; +/// Implementors of this trait are treated as error-handlers. #[async_trait] pub trait ErrorPolicy { type Error; @@ -9,6 +10,8 @@ pub trait ErrorPolicy { async fn handle_error(&mut self, error: Self::Error); } +/// A convenient structure with an error-handling closure. Implements +/// `ErrorPolicy`. pub struct FnErrorPolicy(pub F); #[async_trait]