pub trait WatchlistService: Send + Sync {
// Required methods
fn get_watchlists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WatchlistsResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_watchlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
epics: Option<&'life2 [String]>,
) -> Pin<Box<dyn Future<Output = Result<CreateWatchlistResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_watchlist<'life0, 'life1, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<WatchlistMarketsResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_watchlist<'life0, 'life1, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<StatusResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn add_to_watchlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
epic: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<StatusResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn remove_from_watchlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
epic: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<StatusResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Service for managing watchlists in the IG Markets API
Watchlists allow users to organize and track groups of instruments. This trait provides methods for full CRUD operations on watchlists.
Required Methods§
Sourcefn get_watchlists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WatchlistsResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_watchlists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WatchlistsResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns all watchlists belonging to the active account
§Returns
Ok(WatchlistsResponse)- List of all watchlistsErr(AppError)- If the request fails
Sourcefn create_watchlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
epics: Option<&'life2 [String]>,
) -> Pin<Box<dyn Future<Output = Result<CreateWatchlistResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_watchlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
epics: Option<&'life2 [String]>,
) -> Pin<Box<dyn Future<Output = Result<CreateWatchlistResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn get_watchlist<'life0, 'life1, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<WatchlistMarketsResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_watchlist<'life0, 'life1, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<WatchlistMarketsResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn delete_watchlist<'life0, 'life1, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<StatusResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_watchlist<'life0, 'life1, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<StatusResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn add_to_watchlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
epic: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<StatusResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_to_watchlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
epic: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<StatusResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn remove_from_watchlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
epic: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<StatusResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remove_from_watchlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
watchlist_id: &'life1 str,
epic: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<StatusResponse, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".