KiteTickerAsync

Struct KiteTickerAsync 

Source
pub struct KiteTickerAsync { /* private fields */ }
Expand description

The WebSocket client for connecting to Kite Connect’s streaming quotes service.

Implementations§

Source§

impl KiteTickerAsync

Source

pub async fn connect(api_key: &str, access_token: &str) -> Result<Self, String>

Establish a connection with the Kite WebSocket server

Source

pub async fn connect_with_options( api_key: &str, access_token: &str, raw_only: bool, ) -> Result<Self, String>

Connect with options

Source

pub async fn subscribe( &mut self, instrument_tokens: &[u32], mode: Option<Mode>, ) -> Result<KiteTickerSubscriber, String>

Subscribes the client to a list of instruments

Source

pub async fn close(&mut self) -> Result<(), String>

Close the websocket connection

Source

pub fn is_connected(&self) -> bool

Check if the connection is still alive

Source

pub async fn ping(&mut self) -> Result<(), String>

Send a ping to keep the connection alive

Source

pub fn receiver_count(&self) -> usize

Get the current broadcast channel receiver count

Source

pub fn channel_capacity(&self) -> usize

Get the current broadcast channel capacity

Source

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.

Source

pub fn command_sender(&self) -> Option<UnboundedSender<Message>>

Get a clone of the internal command sender for incremental ops

Trait Implementations§

Source§

impl Debug for KiteTickerAsync

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,