pub struct KiteConnect {
pub(crate) api_key: String,
pub(crate) access_token: String,
pub(crate) session_expiry_hook: Option<fn()>,
pub(crate) client: Client,
}Fields§
§api_key: String§access_token: String§session_expiry_hook: Option<fn()>§client: ClientImplementations§
Source§impl KiteConnect
impl KiteConnect
Sourcepub(crate) fn build_url(
&self,
path: &str,
param: Option<Vec<(&str, &str)>>,
) -> Url
pub(crate) fn build_url( &self, path: &str, param: Option<Vec<(&str, &str)>>, ) -> Url
Constructs url for the given path and query params
Sourcepub fn set_access_token(&mut self, access_token: &str)
pub fn set_access_token(&mut self, access_token: &str)
Sets an access token for this instance
Sourcepub(crate) async fn compute_checksum(&self, input: &str) -> Result<String>
pub(crate) async fn compute_checksum(&self, input: &str) -> Result<String>
Async SHA256 hash computation (platform-specific)
Sourcepub async fn generate_session(
&mut self,
request_token: &str,
api_secret: &str,
) -> Result<JsonValue>
pub async fn generate_session( &mut self, request_token: &str, api_secret: &str, ) -> Result<JsonValue>
Request for access token (now async)
Sourcepub async fn place_order(
&self,
variety: &str,
exchange: &str,
tradingsymbol: &str,
transaction_type: &str,
quantity: &str,
product: Option<&str>,
order_type: Option<&str>,
price: Option<&str>,
validity: Option<&str>,
disclosed_quantity: Option<&str>,
trigger_price: Option<&str>,
squareoff: Option<&str>,
stoploss: Option<&str>,
trailing_stoploss: Option<&str>,
tag: Option<&str>,
) -> Result<JsonValue>
pub async fn place_order( &self, variety: &str, exchange: &str, tradingsymbol: &str, transaction_type: &str, quantity: &str, product: Option<&str>, order_type: Option<&str>, price: Option<&str>, validity: Option<&str>, disclosed_quantity: Option<&str>, trigger_price: Option<&str>, squareoff: Option<&str>, stoploss: Option<&str>, trailing_stoploss: Option<&str>, tag: Option<&str>, ) -> Result<JsonValue>
Place an order (now async)
Sourcepub(crate) async fn raise_or_return_json(
&self,
resp: Response,
) -> Result<JsonValue>
pub(crate) async fn raise_or_return_json( &self, resp: Response, ) -> Result<JsonValue>
Helper method to raise or return json response
Trait Implementations§
Source§impl RequestHandler for KiteConnect
impl RequestHandler for KiteConnect
fn send_request<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
url: Url,
method: &'life1 str,
data: Option<HashMap<&'life2 str, &'life3 str>>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Auto Trait Implementations§
impl Freeze for KiteConnect
impl !RefUnwindSafe for KiteConnect
impl Send for KiteConnect
impl Sync for KiteConnect
impl Unpin for KiteConnect
impl !UnwindSafe for KiteConnect
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