File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ macro_rules! http_variable_get {
8585/// in the `into_handler_status` method.
8686///
8787/// There are predefined implementations for `ngx_int_t`, [`Status`], [`HTTPStatus`],
88- /// [`Option`] with value type implementing [`IntoHandlerStatus`].
88+ /// [`Option`] with value type implementing [`IntoHandlerStatus`],
89+ /// and [`Result`] with value and error types implementing [`IntoHandlerStatus`].
8990pub trait IntoHandlerStatus
9091where
9192 Self : Sized ,
@@ -104,6 +105,16 @@ where
104105 }
105106}
106107
108+ impl < T , E > IntoHandlerStatus for Result < T , E >
109+ where
110+ T : IntoHandlerStatus ,
111+ E : IntoHandlerStatus ,
112+ {
113+ fn into_handler_status ( self , r : & Request ) -> ngx_int_t {
114+ self . map_or_else ( |err| err. into_handler_status ( r) , |val| val. into_handler_status ( r) )
115+ }
116+ }
117+
107118impl IntoHandlerStatus for ngx_int_t {
108119 #[ inline]
109120 fn into_handler_status ( self , _r : & Request ) -> ngx_int_t {
You can’t perform that action at this time.
0 commit comments