pub struct KiteTickerAsync { /* private fields */ }Expand description
The WebSocket client for connecting to Kite Connect’s streaming quotes service.
Implementations§
Source§impl KiteTickerAsync
impl KiteTickerAsync
Sourcepub async fn connect(api_key: &str, access_token: &str) -> Result<Self, String>
pub async fn connect(api_key: &str, access_token: &str) -> Result<Self, String>
Establish a connection with the Kite WebSocket server
Sourcepub async fn connect_with_options(
api_key: &str,
access_token: &str,
raw_only: bool,
) -> Result<Self, String>
pub async fn connect_with_options( api_key: &str, access_token: &str, raw_only: bool, ) -> Result<Self, String>
Connect with options
Sourcepub async fn subscribe(
&mut self,
instrument_tokens: &[u32],
mode: Option<Mode>,
) -> Result<KiteTickerSubscriber, String>
pub async fn subscribe( &mut self, instrument_tokens: &[u32], mode: Option<Mode>, ) -> Result<KiteTickerSubscriber, String>
Subscribes the client to a list of instruments
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if the connection is still alive
Sourcepub fn receiver_count(&self) -> usize
pub fn receiver_count(&self) -> usize
Get the current broadcast channel receiver count
Sourcepub fn channel_capacity(&self) -> usize
pub fn channel_capacity(&self) -> usize
Get the current broadcast channel capacity
Sourcepub fn subscribe_raw(&self) -> Receiver<Arc<[u8]>>
pub fn subscribe_raw(&self) -> Receiver<Arc<[u8]>>
Subscribe to raw binary frames (zero-copy). Each item is an Arc<u8> of the full tungstenite binary frame.
Sourcepub fn command_sender(&self) -> Option<UnboundedSender<Message>>
pub fn command_sender(&self) -> Option<UnboundedSender<Message>>
Get a clone of the internal command sender for incremental ops
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KiteTickerAsync
impl !RefUnwindSafe for KiteTickerAsync
impl Send for KiteTickerAsync
impl Sync for KiteTickerAsync
impl Unpin for KiteTickerAsync
impl !UnwindSafe for KiteTickerAsync
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