#[non_exhaustive]#[repr(u8)]pub enum UserAttribution {
Cn = 1,
Us = 2,
Sg = 3,
Au = 4,
Jp = 5,
Hk = 6,
}Expand description
用户归属地(对齐 C++ FTLogin/Src/ftlogin/ftlogin_def.h:261-270
和 config/impl/user_attr_config.cpp:8-15)
salt 响应里 user_attribution 字段决定认证域名:
- CN / HK →
auth.futunn.com - US / SG / AU / JP →
auth.moomoo.com
海外账号(moomoo)如果发到 futunn 域名会返回 error_code=11(误导为“验证码“,
实际是服务端校验失败),必须按 attribution 切域名。
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl UserAttribution
impl UserAttribution
Sourcepub fn from_u32(v: u32) -> Option<Self>
pub fn from_u32(v: u32) -> Option<Self>
从 salt 响应的 user_attribution 整数字段解析。
未知值(0 或 7+)返回 None,让调用方走 fallback(默认 futunn)。
Sourcepub fn auth_domain(self) -> &'static str
pub fn auth_domain(self) -> &'static str
对齐 C++ user_attr_config.cpp:8-15 的映射表。
Sourcepub fn to_conn_identity(self) -> u32
pub fn to_conn_identity(self) -> u32
TCP 登录 ReqEncryptData.conn_identity 字段:
对齐 C++ FTConnCmn.proto ConnIdentity enum,UserAttribution 数值直接对应
(CN=1, US=2, SG=3, AU=4, JP=5, HK=6,见 user_attr_config.cpp:8-15)
Trait Implementations§
Source§impl Clone for UserAttribution
impl Clone for UserAttribution
Source§fn clone(&self) -> UserAttribution
fn clone(&self) -> UserAttribution
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UserAttribution
impl Debug for UserAttribution
Source§impl<'de> Deserialize<'de> for UserAttribution
impl<'de> Deserialize<'de> for UserAttribution
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for UserAttribution
impl Hash for UserAttribution
Source§impl PartialEq for UserAttribution
impl PartialEq for UserAttribution
Source§impl Serialize for UserAttribution
impl Serialize for UserAttribution
impl Copy for UserAttribution
impl Eq for UserAttribution
impl StructuralPartialEq for UserAttribution
Auto Trait Implementations§
impl Freeze for UserAttribution
impl RefUnwindSafe for UserAttribution
impl Send for UserAttribution
impl Sync for UserAttribution
impl Unpin for UserAttribution
impl UnsafeUnpin for UserAttribution
impl UnwindSafe for UserAttribution
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.