futu_proto/Users/leaf/ai-lab/futu-opend-rs/target/debug/build/futu-proto-732001f670b3b167/out/
common.rs

1// This file is @generated by prost-build.
2/// 包的唯一标识,用于回放攻击的识别和保护
3#[derive(serde::Serialize, serde::Deserialize)]
4#[serde(default)]
5#[derive(Clone, Copy, PartialEq, ::prost::Message)]
6pub struct PacketId {
7    /// 当前TCP连接的连接ID,一条连接的唯一标识,InitConnect协议会返回
8    #[prost(uint64, required, tag = "1")]
9    pub conn_id: u64,
10    /// 自增序列号
11    #[prost(uint32, required, tag = "2")]
12    pub serial_no: u32,
13}
14#[derive(serde::Serialize, serde::Deserialize)]
15#[serde(default)]
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct ProgramStatus {
18    /// 当前状态
19    #[prost(enumeration = "ProgramStatusType", required, tag = "1")]
20    pub r#type: i32,
21    /// 额外描述
22    #[prost(string, optional, tag = "2")]
23    pub str_ext_desc: ::core::option::Option<::prost::alloc::string::String>,
24}
25/// 返回结果
26#[derive(serde::Serialize, serde::Deserialize)]
27#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
28#[repr(i32)]
29pub enum RetType {
30    /// 成功
31    Succeed = 0,
32    /// 失败
33    Failed = -1,
34    /// 超时
35    TimeOut = -100,
36    /// 连接断开
37    DisConnect = -200,
38    /// 未知结果
39    Unknown = -400,
40    /// 包内容非法
41    Invalid = -500,
42}
43impl RetType {
44    /// String value of the enum field names used in the ProtoBuf definition.
45    ///
46    /// The values are not transformed in any way and thus are considered stable
47    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
48    pub fn as_str_name(&self) -> &'static str {
49        match self {
50            Self::Succeed => "RetType_Succeed",
51            Self::Failed => "RetType_Failed",
52            Self::TimeOut => "RetType_TimeOut",
53            Self::DisConnect => "RetType_DisConnect",
54            Self::Unknown => "RetType_Unknown",
55            Self::Invalid => "RetType_Invalid",
56        }
57    }
58    /// Creates an enum from field names used in the ProtoBuf definition.
59    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
60        match value {
61            "RetType_Succeed" => Some(Self::Succeed),
62            "RetType_Failed" => Some(Self::Failed),
63            "RetType_TimeOut" => Some(Self::TimeOut),
64            "RetType_DisConnect" => Some(Self::DisConnect),
65            "RetType_Unknown" => Some(Self::Unknown),
66            "RetType_Invalid" => Some(Self::Invalid),
67            _ => None,
68        }
69    }
70}
71/// 包加密算法
72#[derive(serde::Serialize, serde::Deserialize)]
73#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
74#[repr(i32)]
75pub enum PacketEncAlgo {
76    /// 富途修改过的AES的ECB加密模式
77    FtaesEcb = 0,
78    /// 不加密
79    None = -1,
80    /// 标准的AES的ECB加密模式
81    AesEcb = 1,
82    /// 标准的AES的CBC加密模式
83    AesCbc = 2,
84}
85impl PacketEncAlgo {
86    /// String value of the enum field names used in the ProtoBuf definition.
87    ///
88    /// The values are not transformed in any way and thus are considered stable
89    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
90    pub fn as_str_name(&self) -> &'static str {
91        match self {
92            Self::FtaesEcb => "PacketEncAlgo_FTAES_ECB",
93            Self::None => "PacketEncAlgo_None",
94            Self::AesEcb => "PacketEncAlgo_AES_ECB",
95            Self::AesCbc => "PacketEncAlgo_AES_CBC",
96        }
97    }
98    /// Creates an enum from field names used in the ProtoBuf definition.
99    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
100        match value {
101            "PacketEncAlgo_FTAES_ECB" => Some(Self::FtaesEcb),
102            "PacketEncAlgo_None" => Some(Self::None),
103            "PacketEncAlgo_AES_ECB" => Some(Self::AesEcb),
104            "PacketEncAlgo_AES_CBC" => Some(Self::AesCbc),
105            _ => None,
106        }
107    }
108}
109/// 协议格式,请求协议在请求头中指定,推送协议在Init时指定
110#[derive(serde::Serialize, serde::Deserialize)]
111#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
112#[repr(i32)]
113pub enum ProtoFmt {
114    /// Google Protobuf格式
115    Protobuf = 0,
116    /// Json格式
117    Json = 1,
118}
119impl ProtoFmt {
120    /// String value of the enum field names used in the ProtoBuf definition.
121    ///
122    /// The values are not transformed in any way and thus are considered stable
123    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
124    pub fn as_str_name(&self) -> &'static str {
125        match self {
126            Self::Protobuf => "ProtoFmt_Protobuf",
127            Self::Json => "ProtoFmt_Json",
128        }
129    }
130    /// Creates an enum from field names used in the ProtoBuf definition.
131    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
132        match value {
133            "ProtoFmt_Protobuf" => Some(Self::Protobuf),
134            "ProtoFmt_Json" => Some(Self::Json),
135            _ => None,
136        }
137    }
138}
139/// 用户注册归属地
140#[derive(serde::Serialize, serde::Deserialize)]
141#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
142#[repr(i32)]
143pub enum UserAttribution {
144    ///
145    Unknown = 0,
146    /// 大陆
147    Nn = 1,
148    /// MooMoo
149    Mm = 2,
150    /// 新加坡
151    Sg = 3,
152    /// 澳洲
153    Au = 4,
154    /// 日本
155    Jp = 5,
156    /// 香港
157    Hk = 6,
158}
159impl UserAttribution {
160    /// String value of the enum field names used in the ProtoBuf definition.
161    ///
162    /// The values are not transformed in any way and thus are considered stable
163    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
164    pub fn as_str_name(&self) -> &'static str {
165        match self {
166            Self::Unknown => "UserAttribution_Unknown",
167            Self::Nn => "UserAttribution_NN",
168            Self::Mm => "UserAttribution_MM",
169            Self::Sg => "UserAttribution_SG",
170            Self::Au => "UserAttribution_AU",
171            Self::Jp => "UserAttribution_JP",
172            Self::Hk => "UserAttribution_HK",
173        }
174    }
175    /// Creates an enum from field names used in the ProtoBuf definition.
176    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
177        match value {
178            "UserAttribution_Unknown" => Some(Self::Unknown),
179            "UserAttribution_NN" => Some(Self::Nn),
180            "UserAttribution_MM" => Some(Self::Mm),
181            "UserAttribution_SG" => Some(Self::Sg),
182            "UserAttribution_AU" => Some(Self::Au),
183            "UserAttribution_JP" => Some(Self::Jp),
184            "UserAttribution_HK" => Some(Self::Hk),
185            _ => None,
186        }
187    }
188}
189#[derive(serde::Serialize, serde::Deserialize)]
190#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
191#[repr(i32)]
192pub enum ProgramStatusType {
193    None = 0,
194    /// 已完成类似加载配置,启动服务器等操作,服务器启动之前的状态无需返回
195    Loaded = 1,
196    /// 登录中
197    Loging = 2,
198    /// 需要图形验证码
199    NeedPicVerifyCode = 3,
200    /// 需要手机验证码
201    NeedPhoneVerifyCode = 4,
202    /// 登录失败,详细原因在描述返回
203    LoginFailed = 5,
204    /// 客户端版本过低
205    ForceUpdate = 6,
206    /// 正在拉取类似免责声明等一些必要信息
207    NessaryDataPreparing = 7,
208    /// 缺少必要信息
209    NessaryDataMissing = 8,
210    /// 未同意免责声明
211    UnAgreeDisclaimer = 9,
212    /// 可以接收业务协议收发,正常可用状态
213    Ready = 10,
214    /// OpenD登录后被强制退出登录,会导致连接全部断开,需要重连后才能得到以下该状态(并且需要在ui模式下)
215    ///
216    /// 被强制退出登录,例如修改了登录密码,中途打开设备锁等,详细原因在描述返回
217    ForceLogout = 11,
218    /// 拉取免责声明标志失败
219    DisclaimerPullFailed = 12,
220}
221impl ProgramStatusType {
222    /// String value of the enum field names used in the ProtoBuf definition.
223    ///
224    /// The values are not transformed in any way and thus are considered stable
225    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
226    pub fn as_str_name(&self) -> &'static str {
227        match self {
228            Self::None => "ProgramStatusType_None",
229            Self::Loaded => "ProgramStatusType_Loaded",
230            Self::Loging => "ProgramStatusType_Loging",
231            Self::NeedPicVerifyCode => "ProgramStatusType_NeedPicVerifyCode",
232            Self::NeedPhoneVerifyCode => "ProgramStatusType_NeedPhoneVerifyCode",
233            Self::LoginFailed => "ProgramStatusType_LoginFailed",
234            Self::ForceUpdate => "ProgramStatusType_ForceUpdate",
235            Self::NessaryDataPreparing => "ProgramStatusType_NessaryDataPreparing",
236            Self::NessaryDataMissing => "ProgramStatusType_NessaryDataMissing",
237            Self::UnAgreeDisclaimer => "ProgramStatusType_UnAgreeDisclaimer",
238            Self::Ready => "ProgramStatusType_Ready",
239            Self::ForceLogout => "ProgramStatusType_ForceLogout",
240            Self::DisclaimerPullFailed => "ProgramStatusType_DisclaimerPullFailed",
241        }
242    }
243    /// Creates an enum from field names used in the ProtoBuf definition.
244    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
245        match value {
246            "ProgramStatusType_None" => Some(Self::None),
247            "ProgramStatusType_Loaded" => Some(Self::Loaded),
248            "ProgramStatusType_Loging" => Some(Self::Loging),
249            "ProgramStatusType_NeedPicVerifyCode" => Some(Self::NeedPicVerifyCode),
250            "ProgramStatusType_NeedPhoneVerifyCode" => Some(Self::NeedPhoneVerifyCode),
251            "ProgramStatusType_LoginFailed" => Some(Self::LoginFailed),
252            "ProgramStatusType_ForceUpdate" => Some(Self::ForceUpdate),
253            "ProgramStatusType_NessaryDataPreparing" => Some(Self::NessaryDataPreparing),
254            "ProgramStatusType_NessaryDataMissing" => Some(Self::NessaryDataMissing),
255            "ProgramStatusType_UnAgreeDisclaimer" => Some(Self::UnAgreeDisclaimer),
256            "ProgramStatusType_Ready" => Some(Self::Ready),
257            "ProgramStatusType_ForceLogout" => Some(Self::ForceLogout),
258            "ProgramStatusType_DisclaimerPullFailed" => Some(Self::DisclaimerPullFailed),
259            _ => None,
260        }
261    }
262}
263#[derive(serde::Serialize, serde::Deserialize)]
264#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
265#[repr(i32)]
266pub enum Session {
267    None = 0,
268    Rth = 1,
269    Eth = 2,
270    All = 3,
271    Overnight = 4,
272}
273impl Session {
274    /// String value of the enum field names used in the ProtoBuf definition.
275    ///
276    /// The values are not transformed in any way and thus are considered stable
277    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
278    pub fn as_str_name(&self) -> &'static str {
279        match self {
280            Self::None => "Session_NONE",
281            Self::Rth => "Session_RTH",
282            Self::Eth => "Session_ETH",
283            Self::All => "Session_ALL",
284            Self::Overnight => "Session_OVERNIGHT",
285        }
286    }
287    /// Creates an enum from field names used in the ProtoBuf definition.
288    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
289        match value {
290            "Session_NONE" => Some(Self::None),
291            "Session_RTH" => Some(Self::Rth),
292            "Session_ETH" => Some(Self::Eth),
293            "Session_ALL" => Some(Self::All),
294            "Session_OVERNIGHT" => Some(Self::Overnight),
295            _ => None,
296        }
297    }
298}