pub struct LoginClient<'a> { /* private fields */ }Expand description
Login domain API client.
Implementations§
Source§impl<'a> LoginClient<'a>
impl<'a> LoginClient<'a>
Fetches the current session’s navigation/login state.
Examples found in repository?
9async fn main() -> BpiResult<()> {
10 let client = client_from_env()?;
11 let video_params = VideoViewParams::from_bvid("BV1xx411c7mD".parse::<Bvid>()?);
12 let bangumi_params = BangumiInfoParams::new(MediaId::new(28_220_978)?);
13
14 if !run_live_example() {
15 println!("module-client quickstart compiled; set BPI_RUN_EXAMPLE=1 to call live APIs");
16 return Ok(());
17 }
18
19 let video = client.video().view(video_params).await?;
20 println!("video: {}", video.title);
21
22 let bangumi = client.bangumi().info(bangumi_params).await?;
23 println!("bangumi: {}", bangumi.media.title);
24
25 if env::var_os("BPI_COOKIE").is_some() {
26 let nav = client.login().nav().await?;
27 println!("logged in: {}", nav.is_login);
28 }
29
30 Ok(())
31}Sourcepub async fn stat(&self) -> BpiResult<LoginStats>
pub async fn stat(&self) -> BpiResult<LoginStats>
Fetches the current authenticated user’s following, follower, and dynamic counts.
Sourcepub async fn coin(&self) -> BpiResult<LoginCoinBalance>
pub async fn coin(&self) -> BpiResult<LoginCoinBalance>
Fetches the current authenticated account’s coin balance.
Sourcepub async fn today_coin_exp(&self) -> BpiResult<LoginTodayCoinExp>
pub async fn today_coin_exp(&self) -> BpiResult<LoginTodayCoinExp>
Fetches today’s experience gained from coin operations.
Sourcepub async fn daily_reward(&self) -> BpiResult<LoginDailyReward>
pub async fn daily_reward(&self) -> BpiResult<LoginDailyReward>
Fetches the current authenticated account’s daily reward completion state.
Sourcepub async fn account_info(&self) -> BpiResult<LoginAccountInfo>
pub async fn account_info(&self) -> BpiResult<LoginAccountInfo>
Fetches the current authenticated account’s profile.
Sourcepub async fn vip_info(&self) -> BpiResult<LoginVipInfo>
pub async fn vip_info(&self) -> BpiResult<LoginVipInfo>
Fetches the current authenticated account’s VIP state.
Sourcepub async fn notice(
&self,
params: LoginNoticeParams,
) -> BpiResult<LoginNoticeData>
pub async fn notice( &self, params: LoginNoticeParams, ) -> BpiResult<LoginNoticeData>
Fetches a specific login notice for an authenticated account.
Sourcepub async fn log(&self, params: LoginLogParams) -> BpiResult<LoginLogData>
pub async fn log(&self, params: LoginLogParams) -> BpiResult<LoginLogData>
Fetches recent login log entries for an authenticated account.
Sourcepub async fn generate_captcha(&self) -> BpiResult<GenerateCaptcha>
pub async fn generate_captcha(&self) -> BpiResult<GenerateCaptcha>
Generates a Geetest captcha challenge for login flows.
Sourcepub async fn qr_generate(&self) -> BpiResult<GenerateQrCodeData>
pub async fn qr_generate(&self) -> BpiResult<GenerateQrCodeData>
Generates a QR login URL and temporary polling key.
Sourcepub async fn qr_poll(
&self,
params: LoginQrPollParams,
) -> BpiResult<CheckQrCodeStatusData>
pub async fn qr_poll( &self, params: LoginQrPollParams, ) -> BpiResult<CheckQrCodeStatusData>
Polls the QR login state.
Source§impl<'a> LoginClient<'a>
impl<'a> LoginClient<'a>
Sourcepub async fn logout(&self, params: LogoutWebParams) -> BpiResult<LogoutData>
pub async fn logout(&self, params: LogoutWebParams) -> BpiResult<LogoutData>
Logs out the current web session and returns the canonical payload result.
Source§impl<'a> LoginClient<'a>
impl<'a> LoginClient<'a>
Sourcepub async fn send_sms_code(
&self,
params: LoginSmsCodeParams,
) -> BpiResult<SMSSendData>
pub async fn send_sms_code( &self, params: LoginSmsCodeParams, ) -> BpiResult<SMSSendData>
发送短信验证码(Web端)
Source§impl<'a> LoginClient<'a>
impl<'a> LoginClient<'a>
Sourcepub async fn update_user_sign(
&self,
params: LoginUserSignParams,
) -> BpiResult<Option<Value>>
pub async fn update_user_sign( &self, params: LoginUserSignParams, ) -> BpiResult<Option<Value>>
Updates the member-center user sign and returns the canonical payload result.
Trait Implementations§
Source§impl<'a> Clone for LoginClient<'a>
impl<'a> Clone for LoginClient<'a>
Source§fn clone(&self) -> LoginClient<'a>
fn clone(&self) -> LoginClient<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more