Trait bybit::api::Bybit

source ·
pub trait Bybit<'a> {
    // Required methods
    fn new(
        api_key: Option<Cow<'_, str>>,
        secret_key: Option<Cow<'_, str>>,
    ) -> Self;
    fn new_with_config(
        config: &Config<'_>,
        api_key: Option<Cow<'_, str>>,
        secret_key: Option<Cow<'_, str>>,
    ) -> Self;
}
Expand description

A trait that all modules must implement to be a Bybit API client module.

This trait provides two methods to create a new instance of the module, one with default configuration and one with custom configuration.

Required Methods§

source

fn new(api_key: Option<Cow<'_, str>>, secret_key: Option<Cow<'_, str>>) -> Self

Creates a new instance of the module with default configuration.

§Parameters
  • api_key: The API key to be used for the module.
  • secret_key: The secret key to be used for the module.
§Returns

A new instance of the module.

source

fn new_with_config( config: &Config<'_>, api_key: Option<Cow<'_, str>>, secret_key: Option<Cow<'_, str>>, ) -> Self

Creates a new instance of the module with custom configuration.

§Parameters
  • config: The custom configuration to be used for the module.
  • api_key: The API key to be used for the module.
  • secret_key: The secret key to be used for the module.
§Returns

A new instance of the module.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> Bybit<'a> for AccountManager<'a>

source§

impl<'a> Bybit<'a> for AssetManager<'a>

source§

impl<'a> Bybit<'a> for General<'a>

source§

impl<'a> Bybit<'a> for MarketData<'a>

source§

impl<'a> Bybit<'a> for PositionManager<'a>

source§

impl<'a> Bybit<'a> for Trader<'a>

source§

impl<'a> Bybit<'a> for Stream<'a>