From d21c2710dad9ee593ce2e0bca860dab2f1009a0c Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 17 Feb 2019 10:30:41 +0100 Subject: [PATCH] api_schema/router.rs: improve doc --- src/api_schema/router.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/api_schema/router.rs b/src/api_schema/router.rs index e0fabc72..e4c61bd7 100644 --- a/src/api_schema/router.rs +++ b/src/api_schema/router.rs @@ -12,16 +12,23 @@ use hyper::http::request::Parts; pub type BoxFut = Box, Error = failure::Error> + Send>; +/// Abstract Interface for API methods to interact with the environment pub trait RpcEnvironment { + /// Use this to pass additional result data. It is up to the environment + /// how the data is used. fn set_result_attrib(&mut self, name: &str, value: Value); + /// Query additional result data. fn get_result_attrib(&self, name: &str) -> Option<&Value>; + /// The environment type fn env_type(&self) -> RpcEnvironmentType; + /// Set user name fn set_user(&mut self, user: Option); + /// Get user name fn get_user(&self) -> Option; }