pub struct KiteTickerSubscriber { /* private fields */ }Expand description
The Websocket client that entered in a pub/sub mode once the client subscribed to a list of instruments
Implementations§
Source§impl KiteTickerSubscriber
impl KiteTickerSubscriber
Sourcepub fn get_subscribed(&self) -> Vec<u32>
pub fn get_subscribed(&self) -> Vec<u32>
Get the list of subscribed instruments
Sourcepub async fn subscribe(
&mut self,
tokens: &[u32],
mode: Option<Mode>,
) -> Result<(), String>
pub async fn subscribe( &mut self, tokens: &[u32], mode: Option<Mode>, ) -> Result<(), String>
Subscribe to new tokens
Sourcepub async fn set_mode(
&mut self,
instrument_tokens: &[u32],
mode: Mode,
) -> Result<(), String>
pub async fn set_mode( &mut self, instrument_tokens: &[u32], mode: Mode, ) -> Result<(), String>
Change the mode of the subscribed instrument tokens
Sourcepub async fn unsubscribe(
&mut self,
instrument_tokens: &[u32],
) -> Result<(), String>
pub async fn unsubscribe( &mut self, instrument_tokens: &[u32], ) -> Result<(), String>
Unsubscribe provided subscribed tokens, if input is empty then all subscribed tokens will unsubscribed
Tokens in the input which are not part of the subscribed tokens will be ignored.
Sourcepub async fn next_message(&mut self) -> Result<Option<TickerMessage>, String>
pub async fn next_message(&mut self) -> Result<Option<TickerMessage>, String>
Get the next message from the server, waiting if necessary. If the result is None then server is terminated
pub async fn close(&mut self) -> Result<(), String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KiteTickerSubscriber
impl !RefUnwindSafe for KiteTickerSubscriber
impl Send for KiteTickerSubscriber
impl Sync for KiteTickerSubscriber
impl Unpin for KiteTickerSubscriber
impl !UnwindSafe for KiteTickerSubscriber
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