From d7298ceeca0a3dbc355b3d22d15f94df85c2d3c3 Mon Sep 17 00:00:00 2001 From: Fangdun Tsai Date: Mon, 1 Jan 2024 00:34:34 +0800 Subject: [PATCH] docs: TryHandler --- viz-core/src/handler/try_handler.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/viz-core/src/handler/try_handler.rs b/viz-core/src/handler/try_handler.rs index 4a2edd87..c0fbc999 100644 --- a/viz-core/src/handler/try_handler.rs +++ b/viz-core/src/handler/try_handler.rs @@ -1,10 +1,19 @@ use crate::{BoxFuture, Handler}; +/// A convenience for handlers that return `Result` values that includes +/// a variety of adapters tailored to such futures. pub trait TryHandler: Handler { + /// The type of successful values yielded by this handler type Ok; + /// The type of failures yielded by this handler type Error; + /// Call this `TryHandler` as if it were a `Handler`. + /// + /// This method is a stopgap for a compiler limitation that prevents us from + /// directly inheriting from the `Handler` trait; in the future it won't be + /// needed. fn try_call(&self, input: Input) -> BoxFuture>; }