Skip to main content

DefaultAuthRefresher

Struct DefaultAuthRefresher 

Source
pub struct DefaultAuthRefresher {
    pub http: Client,
    pub account: String,
    pub device_id: String,
    pub region_code: Option<String>,
    pub attribution: UserAttribution,
    pub login_cache: Arc<LoginCache>,
    pub region: String,
    pub server_addr: String,
    pub user_id: u32,
}
Expand description

Production 实装 — 通过 refresh_credentials_on_disk 走 v1.4.34 daemon-reload 的 HTTP /authority/ POST 路径.

字段持有 Arc<...> 以方便从 bridge::ReloadState 派生克隆 (constructor 不耦合 bridge 内部生命期).

Note: Debug 手工实装而非 derive — LoginCache 没 derive Debug (含 parking_lot::RwLock / atomic 等无 Debug 字段), derive 会报 E0277.

Fields§

§http: Client

复用 bridge 创建的 reqwest::Client (含 webpki-roots TLS 配置 + 15s 默认 timeout).

§account: String

归一化后的 account 字符串 (无区号前缀, e.g. “13900000000” 而非 “+86-13900000000”).

§device_id: String

device_id (16-hex hash, 来自磁盘文件).

§region_code: Option<String>

region_code, 手机号账号有, 邮箱/数字 ID 是 None.

§attribution: UserAttribution

user_attribution — 决定派生 auth domain (auth.futunn.com vs auth.moomoo.com).

§login_cache: Arc<LoginCache>

LoginCache 共享指针 — refresh 成功后写 LoginState.is_logged_in=true.

§region: String

region (来自 LoginState — refresh 后写回保持一致).

§server_addr: String

server_addr (来自 LoginState — refresh 后写回保持一致).

§user_id: u32

user_id (来自 LoginState — refresh 后写回保持一致).

Trait Implementations§

Source§

impl AuthRefresher for DefaultAuthRefresher

Source§

fn refresh_qot_login<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

尝试 refresh qot login. 成功 → Ok(()), 失败 → Err.
Source§

impl Debug for DefaultAuthRefresher

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more