From 7c974ee6687229a61760331baf3f749843c23d6c Mon Sep 17 00:00:00 2001 From: Jacob Brown Date: Fri, 10 Jan 2020 12:55:20 -0600 Subject: [PATCH] Update doc comment for `HttpRequest::app_data` (#1265) * update doc comment for `HttpRequest::app_data` * add `no_run` to doc comment * add `ignore` to doc comment * Update src/request.rs Co-Authored-By: Yuki Okushi Co-authored-by: Yuki Okushi --- src/request.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/request.rs b/src/request.rs index b51438950..cd9c72313 100644 --- a/src/request.rs +++ b/src/request.rs @@ -206,8 +206,14 @@ impl HttpRequest { &self.0.config } - /// Get an application data stored with `App::extension()` method during - /// application configuration. + /// Get an application data object stored with `App::data` or `App::app_data` + /// methods during application configuration. + /// + /// If `App::data` was used to store object, use `Data`: + /// + /// ```rust,ignore + /// let opt_t = req.app_data::>(); + /// ``` pub fn app_data(&self) -> Option<&T> { if let Some(st) = self.0.app_data.get::() { Some(&st)