bybit-rust-api 0.3.0

Complete Rust SDK for Bybit API V5 with all endpoints, comprehensive type safety and full test coverage
Documentation
use thiserror::Error;

#[derive(Error, Debug)]
pub enum BybitError {
    #[error("HTTP error: {0}")]
    Http(#[from] reqwest::Error),

    #[error("JSON error: {0}")]
    Json(#[from] serde_json::Error),

    #[error("Serialization error: {0}")]
    UrlEncoded(#[from] serde_urlencoded::ser::Error),

    #[error("API error: {0}")]
    Api(ErrorCodes),

    #[error("Configuration error: {0}")]
    Config(String),

    #[error("Internal error: {0}")]
    Internal(String),

    #[error(transparent)]
    Other(#[from] anyhow::Error),
}

pub type BybitResult<T> = std::result::Result<T, BybitError>;

include!(concat!(env!("OUT_DIR"), "/error_codes.rs"));