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; }