Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive documentation to the Kite Connect API Rust client library. The documentation includes module-level docs, struct/enum descriptions, function documentation with examples, and field-level comments throughout the codebase.
Key Changes
- Added
#![deny(missing_docs)]attribute to enforce documentation coverage - Comprehensive documentation for all public APIs including WebSocket, orders, portfolio, quotes, user management, and historical data modules
- Added usage examples for major API methods
- Documented all struct fields and enum variants with their purposes
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib.rs | Added crate-level documentation with getting started guide and authentication flow examples |
| src/ws.rs | Documented WebSocket ticker structures, subscription modes, and real-time market data functionality |
| src/orders.rs | Added documentation for order types, varieties, placement/modification/cancellation methods with examples |
| src/portfolio.rs | Documented holdings, positions, and position conversion functionality |
| src/quotes.rs | Added documentation for instruments, quotes (LTP/OHLC/full), and market depth structures |
| src/user/*.rs | Documented user profile, session tokens, and funds/margins functionality |
| src/virtual_contract_note.rs | Documented charge calculation structures and functions |
| src/historical.rs | Added documentation for historical candle data retrieval |
| src/utils.rs | Documented API version constants |
| src/response.rs | Added field-level documentation for response enum variants |
| src/error.rs | Added documentation for error types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// | ||
| /// # Returns | ||
| /// | ||
| /// * `Ok(Order)` containing the order information |
There was a problem hiding this comment.
The documentation states the return type is Ok(Order), but this is incorrect. Based on the API documentation and the note in the comment itself, this method should return Vec<Order> (a vector of orders), not a single Order. The documentation comment itself acknowledges this issue with a note about the incorrect return type.
| /// * `Ok(Order)` containing the order information | |
| /// * `Ok(Vec<Order>)` containing the list of orders |
| /// let nse_instruments = kite.get_exhchange_instruments(Exchange::NSE).await?; | ||
| /// println!("NSE instruments: {}", nse_instruments.len()); | ||
| /// # Ok(()) | ||
| /// # } | ||
| /// ``` | ||
| pub async fn get_exhchange_instruments( |
There was a problem hiding this comment.
There's a typo in the function name: get_exhchange_instruments should be get_exchange_instruments. The extra 'h' makes this a misspelling.
| /// let nse_instruments = kite.get_exhchange_instruments(Exchange::NSE).await?; | |
| /// println!("NSE instruments: {}", nse_instruments.len()); | |
| /// # Ok(()) | |
| /// # } | |
| /// ``` | |
| pub async fn get_exhchange_instruments( | |
| /// let nse_instruments = kite.get_exchange_instruments(Exchange::NSE).await?; | |
| /// println!("NSE instruments: {}", nse_instruments.len()); | |
| /// # Ok(()) | |
| /// # } | |
| /// ``` | |
| pub async fn get_exchange_instruments( |
| /// let nse_instruments = kite.get_exhchange_instruments(Exchange::NSE).await?; | ||
| /// println!("NSE instruments: {}", nse_instruments.len()); | ||
| /// # Ok(()) | ||
| /// # } | ||
| /// ``` | ||
| pub async fn get_exhchange_instruments( |
There was a problem hiding this comment.
There's a typo in the function name used in the example: get_exhchange_instruments should be get_exchange_instruments. The extra 'h' makes this a misspelling.
| /// let nse_instruments = kite.get_exhchange_instruments(Exchange::NSE).await?; | |
| /// println!("NSE instruments: {}", nse_instruments.len()); | |
| /// # Ok(()) | |
| /// # } | |
| /// ``` | |
| pub async fn get_exhchange_instruments( | |
| /// let nse_instruments = kite.get_exchange_instruments(Exchange::NSE).await?; | |
| /// println!("NSE instruments: {}", nse_instruments.len()); | |
| /// # Ok(()) | |
| /// # } | |
| /// ``` | |
| pub async fn get_exchange_instruments( |
| /// | ||
| /// # Returns | ||
| /// | ||
| /// * `Ok(LtpQuote)` - The LTP quote (Note: The return type appears incorrect; should be `HashMap<String, LtpQuote>`) |
There was a problem hiding this comment.
The documentation states the return type is Ok(LtpQuote), but this is incorrect. Based on the pattern of other similar methods in this file (get_market_quotes and get_ohlc_quotes), this method should return HashMap<String, LtpQuote>, not a single LtpQuote. The documentation comment itself acknowledges this issue in a note.
| /// * `Ok(LtpQuote)` - The LTP quote (Note: The return type appears incorrect; should be `HashMap<String, LtpQuote>`) | |
| /// * `Ok(HashMap<String, LtpQuote>)` - The LTP quotes for the requested instruments |
| /// kite.modify_regular_oder("order_id", &modify_req).await?; | ||
| /// # Ok(()) | ||
| /// # } | ||
| /// ``` | ||
| pub async fn modify_regular_oder( |
There was a problem hiding this comment.
There's a typo in the function name: modify_regular_oder should be modify_regular_order. The word "oder" is misspelled - it should be "order".
| /// kite.modify_regular_oder("order_id", &modify_req).await?; | |
| /// # Ok(()) | |
| /// # } | |
| /// ``` | |
| pub async fn modify_regular_oder( | |
| /// kite.modify_regular_order("order_id", &modify_req).await?; | |
| /// # Ok(()) | |
| /// # } | |
| /// ``` | |
| pub async fn modify_regular_order( |
| /// kite.modify_regular_oder("order_id", &modify_req).await?; | ||
| /// # Ok(()) | ||
| /// # } | ||
| /// ``` | ||
| pub async fn modify_regular_oder( |
There was a problem hiding this comment.
There's a typo in the function name: modify_regular_oder should be modify_regular_order. The word "oder" is misspelled - it should be "order".
| /// kite.modify_regular_oder("order_id", &modify_req).await?; | |
| /// # Ok(()) | |
| /// # } | |
| /// ``` | |
| pub async fn modify_regular_oder( | |
| /// kite.modify_regular_order("order_id", &modify_req).await?; | |
| /// # Ok(()) | |
| /// # } | |
| /// ``` | |
| pub async fn modify_regular_order( |
No description provided.