Trait Bybit

Source
pub trait Bybit {
    // Required methods
    fn new(api_key: Option<String>, secret_key: Option<String>) -> Self;
    fn new_with_config(
        config: &Config,
        api_key: Option<String>,
        secret_key: Option<String>,
    ) -> 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<String>, secret_key: Option<String>) -> 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<String>, secret_key: Option<String>, ) -> 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§