pub struct AuthConfig {
pub auth_server: String,
pub account: String,
pub password: String,
pub password_is_md5: bool,
pub device_id: String,
pub client_type: u8,
}Expand description
v1.4.19:ZeroizeOnDrop 让 AuthConfig drop 时自动把 password 字段的
堆内存清零,减少进程 core dump / /proc/<pid>/mem 读到明文的窗口。
其他字段(auth_server / account / device_id)不是秘密,#[zeroize(skip)]
跳过。注意 Clone 每次复制都会产生新堆分配,drop 时各自 zeroize。
Fields§
§auth_server: String§account: String§password: String密码:password_is_md5 = false 时是明文(内部做 MD5);
password_is_md5 = true 时是 32 位小写 hex 的 MD5(直接使用)。
drop 时自动 zeroize。
password_is_md5: bool是否为预哈希 MD5;false 时按明文处理
device_id: String§client_type: u8HTTP X-Futu-Client-Type header 值。
对齐 C++ NNBase_Define_Enum.h:1113-1114:
40=NN_ClientType_FutuOpenD(牛牛 FTNN)60=NN_ClientType_FutuOpenDMooMoo(moomoo FTMM)
v1.4.15:moomoo 的 auth.moomoo.com 对 client-type=40 直接拒绝
(返回 error_code=2),必须用 60。由 --platform flag 决定。
Trait Implementations§
Source§impl Clone for AuthConfig
impl Clone for AuthConfig
Source§fn clone(&self) -> AuthConfig
fn clone(&self) -> AuthConfig
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 AuthConfig
impl Debug for AuthConfig
Auto Trait Implementations§
impl Freeze for AuthConfig
impl RefUnwindSafe for AuthConfig
impl Send for AuthConfig
impl Sync for AuthConfig
impl Unpin for AuthConfig
impl UnsafeUnpin for AuthConfig
impl UnwindSafe for AuthConfig
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