Skip to content

Conversation

@AS1100K
Copy link
Owner

@AS1100K AS1100K commented Dec 4, 2025

No description provided.

@AS1100K AS1100K added this to the v0.1.0 milestone Dec 4, 2025
@AS1100K AS1100K requested a review from Copilot December 4, 2025 00:49
@AS1100K AS1100K self-assigned this Dec 4, 2025
@AS1100K AS1100K added the documentation Improvements or additions to documentation label Dec 4, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
/// * `Ok(Order)` containing the order information
/// * `Ok(Vec<Order>)` containing the list of orders

Copilot uses AI. Check for mistakes.
Comment on lines +270 to 275
/// let nse_instruments = kite.get_exhchange_instruments(Exchange::NSE).await?;
/// println!("NSE instruments: {}", nse_instruments.len());
/// # Ok(())
/// # }
/// ```
pub async fn get_exhchange_instruments(
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo in the function name: get_exhchange_instruments should be get_exchange_instruments. The extra 'h' makes this a misspelling.

Suggested change
/// 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(

Copilot uses AI. Check for mistakes.
Comment on lines +270 to 275
/// let nse_instruments = kite.get_exhchange_instruments(Exchange::NSE).await?;
/// println!("NSE instruments: {}", nse_instruments.len());
/// # Ok(())
/// # }
/// ```
pub async fn get_exhchange_instruments(
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
/// 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(

Copilot uses AI. Check for mistakes.
///
/// # Returns
///
/// * `Ok(LtpQuote)` - The LTP quote (Note: The return type appears incorrect; should be `HashMap<String, LtpQuote>`)
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
/// * `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

Copilot uses AI. Check for mistakes.
Comment on lines +511 to 515
/// kite.modify_regular_oder("order_id", &modify_req).await?;
/// # Ok(())
/// # }
/// ```
pub async fn modify_regular_oder(
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Suggested change
/// 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(

Copilot uses AI. Check for mistakes.
Comment on lines +511 to 515
/// kite.modify_regular_oder("order_id", &modify_req).await?;
/// # Ok(())
/// # }
/// ```
pub async fn modify_regular_oder(
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Suggested change
/// 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(

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant