pub struct WebsocketService<S: WebSocketSource> { /* private fields */ }Expand description
A caching object storing prices received from WebSocketSource.
Implementations§
Source§impl<S: WebSocketSource> WebsocketService<S>
impl<S: WebSocketSource> WebsocketService<S>
Trait Implementations§
Source§impl<S: WebSocketSource> Service for WebsocketService<S>
impl<S: WebSocketSource> Service for WebsocketService<S>
Source§fn start<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
symbols: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn start<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
symbols: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Starts the service, connecting to the WebSocket and subscribing to symbols.
Source§fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stops the service, cancelling the WebSocket subscription.
fn is_started<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl<S: WebSocketSource> Source for WebsocketService<S>
impl<S: WebSocketSource> Source for WebsocketService<S>
Source§fn get_prices<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
symbols: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Vec<Result<PriceInfo, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_prices<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
symbols: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Vec<Result<PriceInfo, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves prices for the specified symbols from the cached prices.
Source§fn get_price<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PriceInfo, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_price<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PriceInfo, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Asynchronously retrieves the price for a specified symbol. Read more
Auto Trait Implementations§
impl<S> Freeze for WebsocketService<S>
impl<S> !RefUnwindSafe for WebsocketService<S>
impl<S> Send for WebsocketService<S>
impl<S> Sync for WebsocketService<S>
impl<S> Unpin for WebsocketService<S>
impl<S> !UnwindSafe for WebsocketService<S>
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