Expand description
§fyers
An idiomatic, strongly-typed, async Rust client for the Fyers Trading API.
§Overview
This crate provides a type-safe interface to the Fyers REST API, modeling requests and responses as Rust types rather than exposing raw JSON values.
§Example
use fyers::{Fyers, FyersError};
#[tokio::main]
async fn main() -> Result<(), FyersError> {
let fyers = Fyers::new("CLIENT_ID", "ACCESS_TOKEN");
let profile = fyers.profile().await?;
println!("{profile:?}");
Ok(())
}Re-exports§
pub use client::Fyers;
Modules§
Structs§
- Candle
- A single OHLCV candle returned by the Fyers History API.
- History
Builder - Builder for creating a
HistoryRequestused withFyers::history. - History
Request - The request type sent to the Fyers history API.
- Order
- Returned on successfully placing an order.
- Order
Builder - Builder for creating an
OrderRequestused withFyers::place_order. - Order
Request - The request type sent to the Fyers place order API.
- Profile
- Basic account profile information returned by the Fyers API.
Enums§
- Candle
Resolution - Candle timeframe used when requesting historical market data.
- Exit
Position Result - Result of an exit position operation.
- Fyers
Error - Errors that can occur when interacting with the Fyers API.
- Order
Type - Type of order to place.
- Product
Type - Product type for an order.
- Side
- Order side used when placing trades.
- Validity
- Order validity specifying how long the order remains active.
Functions§
- ist_
datetime - Create a UTC DateTime from an IST date/time.