]>
git.proxmox.com Git - proxmox-backup.git/blob - src/cli/environment.rs
cd4179d8daa41f1db40797649570d7b97313180b
1 use crate::api
::router
::*;
3 use std
::collections
::HashMap
;
6 pub struct CliEnvironment
{
7 result_attributes
: HashMap
<String
, Value
>,
12 pub fn new() -> Self {
14 result_attributes
: HashMap
::new(),
20 impl RpcEnvironment
for CliEnvironment
{
22 fn set_result_attrib(&mut self, name
: &str, value
: Value
) {
23 self.result_attributes
.insert(name
.into(), value
);
26 fn get_result_attrib(&self, name
: &str) -> Option
<&Value
> {
27 self.result_attributes
.get(name
)
30 fn env_type(&self) -> RpcEnvironmentType
{
31 RpcEnvironmentType
::CLI
34 fn set_user(&mut self, user
: Option
<String
>) {
38 fn get_user(&self) -> Option
<String
> {