[][src]Struct questrade_rs::Questrade

pub struct Questrade { /* fields omitted */ }

Questrade client

Implementations

impl Questrade[src]

pub fn new() -> Self[src]

Creates a new API instance with the default client.

pub fn with_client(client: Client) -> Self[src]

Creates a new API instance with the specified client

pub fn with_authentication(
    auth_info: AuthenticationInfo,
    client: Client
) -> Self
[src]

Creates a new API instance with the specified auth info.

pub async fn authenticate<'_, '_>(
    &'_ self,
    refresh_token: &'_ str,
    is_demo: bool
) -> Result<(), Box<dyn Error>>
[src]

Authenticates using the supplied token.

pub fn get_auth_info(&self) -> Option<AuthenticationInfo>[src]

Retrieves the current authentication info (if set).

pub async fn accounts<'_>(&'_ self) -> Result<Vec<Account>, Box<dyn Error>>[src]

List all accounts associated with the authenticated user.

pub async fn account_activity<'_, '_>(
    &'_ self,
    account_number: &'_ str,
    start_time: DateTime<Utc>,
    end_time: DateTime<Utc>
) -> Result<Vec<AccountActivity>, Box<dyn Error>>
[src]

Retrieve account activities, including cash transactions, dividends, trades, etc.

pub async fn account_orders<'_, '_>(
    &'_ self,
    account_number: &'_ str,
    start_time: Option<DateTime<Utc>>,
    end_time: Option<DateTime<Utc>>,
    state: Option<OrderStateFilter>
) -> Result<Vec<AccountOrder>, Box<dyn Error>>
[src]

Search for account orders.

Parameters: - start_time optional start of time range. Defaults to start of today, 12:00am - end_time optional end of time range. Defaults to end of today, 11:59pm - state_filter optionally filters order states

pub async fn account_order<'_, '_>(
    &'_ self,
    account_number: &'_ str,
    order_id: u32
) -> Result<Option<AccountOrder>, Box<dyn Error>>
[src]

Retrieve details for an order with a specific id

pub async fn account_executions<'_, '_>(
    &'_ self,
    account_number: &'_ str,
    start_time: Option<DateTime<Utc>>,
    end_time: Option<DateTime<Utc>>
) -> Result<Vec<AccountExecution>, Box<dyn Error>>
[src]

Retrieves executions for a specific account.

Parameters: - start_time optional start of time range. Defaults to start of today, 12:00am - end_time optional end of time range. Defaults to end of today, 11:59pm

pub async fn account_balance<'_, '_>(
    &'_ self,
    account_number: &'_ str
) -> Result<AccountBalances, Box<dyn Error>>
[src]

Retrieves per-currency and combined balances for a specified account.

pub async fn account_positions<'_, '_>(
    &'_ self,
    account_number: &'_ str
) -> Result<Vec<AccountPosition>, Box<dyn Error>>
[src]

Retrieves positions in a specified account.

pub async fn market_quote<'_, '_>(
    &'_ self,
    ids: &'_ [u32]
) -> Result<Vec<MarketQuote>, Box<dyn Error>>
[src]

Retrieves a single Level 1 market data quote for one or more symbols.

IMPORTANT NOTE: Questrade user needs to be subscribed to a real-time data package, to receive market quotes in real-time, otherwise call to get quote is considered snap quote and limit per market can be quickly reached. Without real-time data package, once limit is reached, the response will return delayed data. (Please check "delay" parameter in response always)

Searches for the specified symbol.

params

  • prefix Prefix of a symbol or any word in the description.
  • offset Offset in number of records from the beginning of a result set.

pub async fn time<'_>(&'_ self) -> Result<DateTime<Utc>, Box<dyn Error>>[src]

Retrieves current server time.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.