1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#![allow(unused_imports)]
#![allow(unused_extern_crates)]
#![cfg_attr(feature = "cargo-clippy", allow(too_many_arguments, type_complexity))]
#![cfg_attr(rustfmt, rustfmt_skip)]
extern crate ordered_float;
extern crate thrift;
extern crate try_from;
use ordered_float::OrderedFloat;
use std::cell::RefCell;
use std::collections::{BTreeMap, BTreeSet};
use std::convert::From;
use std::default::Default;
use std::error::Error;
use std::fmt;
use std::fmt::{Display, Formatter};
use std::rc::Rc;
use try_from::TryFrom;
use thrift::{ApplicationError, ApplicationErrorKind, ProtocolError, ProtocolErrorKind, TThriftClient};
use thrift::protocol::{TFieldIdentifier, TListIdentifier, TMapIdentifier, TMessageIdentifier, TMessageType, TInputProtocol, TOutputProtocol, TSetIdentifier, TStructIdentifier, TType};
use thrift::protocol::field_id;
use thrift::protocol::verify_expected_message_type;
use thrift::protocol::verify_expected_sequence_number;
use thrift::protocol::verify_expected_service_call;
use thrift::protocol::verify_required_field_exists;
use thrift::server::TProcessor;
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct GetLocalPathResult {
pub result: Option<bool>,
pub path: Option<String>,
}
impl GetLocalPathResult {
pub fn new<F1, F2>(result: F1, path: F2) -> GetLocalPathResult where F1: Into<Option<bool>>, F2: Into<Option<String>> {
GetLocalPathResult {
result: result.into(),
path: path.into(),
}
}
pub fn read_from_in_protocol(i_prot: &mut TInputProtocol) -> thrift::Result<GetLocalPathResult> {
i_prot.read_struct_begin()?;
let mut f_1: Option<bool> = Some(false);
let mut f_2: Option<String> = Some("".to_owned());
loop {
let field_ident = i_prot.read_field_begin()?;
if field_ident.field_type == TType::Stop {
break;
}
let field_id = field_id(&field_ident)?;
match field_id {
1 => {
let val = i_prot.read_bool()?;
f_1 = Some(val);
},
2 => {
let val = i_prot.read_string()?;
f_2 = Some(val);
},
_ => {
i_prot.skip(field_ident.field_type)?;
},
};
i_prot.read_field_end()?;
}
i_prot.read_struct_end()?;
let ret = GetLocalPathResult {
result: f_1,
path: f_2,
};
Ok(ret)
}
pub fn write_to_out_protocol(&self, o_prot: &mut TOutputProtocol) -> thrift::Result<()> {
let struct_ident = TStructIdentifier::new("GetLocalPathResult");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(fld_var) = self.result {
o_prot.write_field_begin(&TFieldIdentifier::new("result", TType::Bool, 1))?;
o_prot.write_bool(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
if let Some(ref fld_var) = self.path {
o_prot.write_field_begin(&TFieldIdentifier::new("path", TType::String, 2))?;
o_prot.write_string(fld_var)?;
o_prot.write_field_end()?;
()
} else {
()
}
o_prot.write_field_stop()?;
o_prot.write_struct_end()
}
}
impl Default for GetLocalPathResult {
fn default() -> Self {
GetLocalPathResult{
result: Some(false),
path: Some("".to_owned()),
}
}
}