Trait JQuantsPlanClient

Source
pub trait JQuantsPlanClient: Clone {
    // Required methods
    fn new(api_client: JQuantsApiClient) -> Self;
    fn get_api_client(&self) -> &JQuantsApiClient;

    // Provided methods
    fn new_from_refresh_token(refresh_token: String) -> Self { ... }
    fn new_from_account(
        mailaddress: &str,
        password: &str,
    ) -> impl Future<Output = Result<Self, JQuantsError>> + Send { ... }
    fn get_current_refresh_token(&self) -> impl Future<Output = String> + Send { ... }
    fn get_refresh_token_from_api(
        &self,
        mail_address: &str,
        password: &str,
    ) -> impl Future<Output = Result<String, JQuantsError>> + Send { ... }
    fn get_id_token_from_api(
        &self,
        refresh_token: &str,
    ) -> impl Future<Output = Result<String, JQuantsError>> + Send { ... }
    fn reset_refresh_token(
        &self,
        mail_address: &str,
        password: &str,
    ) -> impl Future<Output = Result<(), JQuantsError>> + Send { ... }
    fn reset_id_token(
        &self,
    ) -> impl Future<Output = Result<(), JQuantsError>> + Send { ... }
    fn reauthenticate(
        &self,
        mail_address: &str,
        password: &str,
    ) -> impl Future<Output = Result<(), JQuantsError>> + Send { ... }
}
Expand description

J-Quants API client trait

Required Methods§

Source

fn new(api_client: JQuantsApiClient) -> Self

Create a new client from an API client.

Source

fn get_api_client(&self) -> &JQuantsApiClient

Get the API client.

Provided Methods§

Source

fn new_from_refresh_token(refresh_token: String) -> Self

Create a new client from a refresh token.

Source

fn new_from_account( mailaddress: &str, password: &str, ) -> impl Future<Output = Result<Self, JQuantsError>> + Send

Create a new client from an account.

Source

fn get_current_refresh_token(&self) -> impl Future<Output = String> + Send

Get a current refresh token.

Source

fn get_refresh_token_from_api( &self, mail_address: &str, password: &str, ) -> impl Future<Output = Result<String, JQuantsError>> + Send

Get a new refresh token from an account. But don’t update the ID token in the client.

Use refresh_refresh_token if you want to update the refresh token in the client.

Source

fn get_id_token_from_api( &self, refresh_token: &str, ) -> impl Future<Output = Result<String, JQuantsError>> + Send

Get a new ID token from a refresh token. But don’t update the ID token in the client.

Use refresh_id_token if you want to update the ID token in the client.

Source

fn reset_refresh_token( &self, mail_address: &str, password: &str, ) -> impl Future<Output = Result<(), JQuantsError>> + Send

Renew the refresh token in the client.

Source

fn reset_id_token( &self, ) -> impl Future<Output = Result<(), JQuantsError>> + Send

Renew the ID token in the client.

Source

fn reauthenticate( &self, mail_address: &str, password: &str, ) -> impl Future<Output = Result<(), JQuantsError>> + Send

Reauthenticate with a new refresh token and a new id token.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§