1 use serde_json
::{json, Value}
;
3 use proxmox
::api
::{RpcEnvironment, RpcEnvironmentType}
;
5 /// Encapsulates information about the runtime environment
6 pub struct RestEnvironment
{
7 env_type
: RpcEnvironmentType
,
8 result_attributes
: Value
,
12 impl RestEnvironment
{
13 pub fn new(env_type
: RpcEnvironmentType
) -> Self {
15 result_attributes
: json
!({}
),
22 impl RpcEnvironment
for RestEnvironment
{
24 fn result_attrib_mut (&mut self) -> &mut Value
{
25 &mut self.result_attributes
28 fn result_attrib(&self) -> &Value
{
29 &self.result_attributes
32 fn env_type(&self) -> RpcEnvironmentType
{
36 fn set_user(&mut self, user
: Option
<String
>) {
40 fn get_user(&self) -> Option
<String
> {