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_frames(&self) -> Receiver<Bytes>
pub fn subscribe_raw_frames(&self) -> Receiver<Bytes>
Subscribe to raw binary frames (zero-copy). Each item is the full websocket frame bytes.
Use this to implement custom parsing or zero-copy peeking on packet bodies.
Each emitted item is a bytes::Bytes that shares the underlying frame buffer (clone is cheap).
See the crate-level docs for an end-to-end example of slicing packet bodies from a frame.
Sourcepub fn subscribe_raw(&self) -> Receiver<Bytes>
👎Deprecated: use subscribe_raw_frames() instead; now returns bytes::Bytes
pub fn subscribe_raw(&self) -> Receiver<Bytes>
Backward-compatible alias for subscribe_raw_frames.
Sourcepub fn subscribe_full_raw(&self) -> KiteTickerRawSubscriber184
pub fn subscribe_full_raw(&self) -> KiteTickerRawSubscriber184
Create a subscriber that yields only 184-byte Full tick payloads sliced from frames.
The returned subscriber exposes convenience methods to receive raw Bytes, a fixed [u8;184]
reference, or a zerocopy::Ref<&[u8], TickRaw> view via recv_raw_tickraw.
Note: the typed Ref returned by recv_raw_tickraw is valid until the next method call that
overwrites the internal buffer. If you need to hold onto the data longer, clone the Bytes and
re-create the view as needed using as_tick_raw.
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