pub trait IgAuthenticator: Send + Sync {
// Required methods
fn login<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IgSession, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn refresh<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
) -> Pin<Box<dyn Future<Output = Result<IgSession, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn switch_account<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
account_id: &'life2 str,
default_account: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<IgSession, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Trait for authenticating with the IG Markets API
Required Methods§
Sourcefn login<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IgSession, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn login<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IgSession, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Logs in to the IG Markets API and returns a new session
Sourcefn refresh<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
) -> Pin<Box<dyn Future<Output = Result<IgSession, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn refresh<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
) -> Pin<Box<dyn Future<Output = Result<IgSession, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Refreshes an existing session with the IG Markets API