Trait IgAuthenticator

Source
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;
}
Expand description

Trait for authenticating with the IG Markets API

Required Methods§

Source

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

Source

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

Implementors§