pub struct AccountServiceImpl<T: IgHttpClient> { /* private fields */ }Expand description
Implementation of the account service
Implementations§
Source§impl<T: IgHttpClient> AccountServiceImpl<T>
impl<T: IgHttpClient> AccountServiceImpl<T>
Trait Implementations§
Source§impl<T: IgHttpClient + 'static> AccountService for AccountServiceImpl<T>
impl<T: IgHttpClient + 'static> AccountService for AccountServiceImpl<T>
Source§fn get_positions_w_filter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
filter: &'life1 str,
session: &'life2 IgSession,
) -> Pin<Box<dyn Future<Output = Result<Positions, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_positions_w_filter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
filter: &'life1 str,
session: &'life2 IgSession,
) -> Pin<Box<dyn Future<Output = Result<Positions, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves the current open positions and applies a client-side filter to them.
This function first delegates to get_positions to fetch all open positions
and then narrows the result set in-memory using the provided filter.
The exact matching logic is implementation-defined for now (based on how the
filter predicate is applied within this function).
Logging:
- Emits a debug log before and after fetching/filtering to aid observability.
Arguments:
filter: A string used to filter the list of positions. The matching semantics depend on the predicate used in this function (e.g., substring match against one or morePositionfields).session: An authenticated IG session used to authorize the HTTP request.
Returns:
Ok(Positions): The filtered collection of open positions.Err(AppError): If fetching or processing fails. Possible error sources include network issues, deserialization errors, authorization failures, rate limiting, or invalid input.
Source§fn get_accounts<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
) -> Pin<Box<dyn Future<Output = Result<AccountInfo, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_accounts<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
) -> Pin<Box<dyn Future<Output = Result<AccountInfo, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets information about all user accounts
Source§fn get_positions<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
) -> Pin<Box<dyn Future<Output = Result<Positions, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_positions<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
) -> Pin<Box<dyn Future<Output = Result<Positions, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets open positions
Source§fn get_working_orders<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
) -> Pin<Box<dyn Future<Output = Result<WorkingOrders, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_working_orders<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
) -> Pin<Box<dyn Future<Output = Result<WorkingOrders, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets working orders
Source§fn get_activity<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
from: &'life2 str,
to: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<AccountActivity, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_activity<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
from: &'life2 str,
to: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<AccountActivity, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Gets account activity Read more
Source§fn get_activity_with_details<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
from: &'life2 str,
to: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<AccountActivity, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_activity_with_details<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
from: &'life2 str,
to: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<AccountActivity, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Gets detailed account activity Read more
Source§fn get_transactions<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
from: &'life2 str,
to: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<TransactionHistory, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_transactions<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 IgSession,
from: &'life2 str,
to: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<TransactionHistory, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Gets transaction history for a given period, handling pagination automatically.
Auto Trait Implementations§
impl<T> Freeze for AccountServiceImpl<T>
impl<T> RefUnwindSafe for AccountServiceImpl<T>where
T: RefUnwindSafe,
impl<T> Send for AccountServiceImpl<T>
impl<T> Sync for AccountServiceImpl<T>
impl<T> Unpin for AccountServiceImpl<T>
impl<T> UnwindSafe for AccountServiceImpl<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more