Struct BithumbConfig

Source
pub struct BithumbConfig {
Show 17 fields pub api_url: SmartString, pub ws_url: SmartString, pub timeout: Duration, pub max_retries: usize, pub ping_interval: Duration, pub enable_testnet: bool, pub rate_limit_window: Duration, pub rate_limit_per_window: u32, pub user_agent: SmartString, pub connection_pool_size: usize, pub keep_alive_timeout: Duration, pub enable_logging: bool, pub enable_metrics: bool, pub ws_reconnect_attempts: usize, pub ws_reconnect_delay: Duration, pub validate_orders: bool, pub min_order_validation: bool,
}
Expand description

Bithumb exchange configuration

Fields§

§api_url: SmartString

API base URL

§ws_url: SmartString

WebSocket URL

§timeout: Duration

Request timeout duration

§max_retries: usize

Maximum retry attempts

§ping_interval: Duration

Ping interval for WebSocket

§enable_testnet: bool

Enable testnet mode

§rate_limit_window: Duration

Rate limit window duration

§rate_limit_per_window: u32

Rate limit per window

§user_agent: SmartString

User agent string for requests

§connection_pool_size: usize

Connection pool settings

§keep_alive_timeout: Duration

Keep-alive timeout

§enable_logging: bool

Enable request/response logging

§enable_metrics: bool

Enable performance metrics

§ws_reconnect_attempts: usize

WebSocket reconnection settings

§ws_reconnect_delay: Duration

Delay between WebSocket reconnection attempts

§validate_orders: bool

Order validation settings

§min_order_validation: bool

Enable minimum order amount validation

Implementations§

Source§

impl BithumbConfig

Source

pub fn new() -> Self

Create a new configuration with default values

Source

pub fn testnet() -> Self

Create configuration for testnet

§Note

Bithumb does not support a testnet environment. This method returns a production configuration and logs a warning. Use production() instead.

Source

pub fn production() -> Self

Create configuration for production

Source

pub fn high_frequency() -> Self

Create configuration for high-frequency trading

Source

pub fn with_api_url(self, url: impl Into<SmartString>) -> Self

Set API URL

Source

pub fn with_ws_url(self, url: impl Into<SmartString>) -> Self

Set WebSocket URL

Source

pub const fn with_timeout(self, timeout: Duration) -> Self

Set timeout

Source

pub const fn with_max_retries(self, max_retries: usize) -> Self

Set maximum retries

Source

pub const fn with_ping_interval(self, interval: Duration) -> Self

Set ping interval

Source

pub fn with_testnet(self, enable: bool) -> BithumbResult<Self>

Enable testnet mode

Source

pub const fn with_rate_limit(self, window: Duration, per_window: u32) -> Self

Set rate limiting

Source

pub fn with_user_agent(self, user_agent: impl Into<SmartString>) -> Self

Set user agent

Source

pub const fn with_connection_pool_size(self, size: usize) -> Self

Set connection pool size

Source

pub const fn with_logging(self, enable: bool) -> Self

Enable logging

Source

pub const fn with_metrics(self, enable: bool) -> Self

Enable metrics

Source

pub const fn with_ws_reconnect(self, attempts: usize, delay: Duration) -> Self

Set WebSocket reconnection settings

Source

pub const fn with_order_validation( self, validate: bool, min_validate: bool, ) -> Self

Set order validation

Source

pub fn validate(&self) -> Result<(), String>

Validate configuration

Source§

impl BithumbConfig

Helper functions for configuration

Source

pub fn is_symbol_supported(&self, symbol: &str) -> bool

Check if symbol is supported

Source

pub fn get_min_order_amount(&self, symbol: &str) -> Option<u64>

Get minimum order amount for symbol

Source

pub fn get_api_url(&self) -> BithumbResult<&SmartString>

Get effective API URL based on testnet setting

Source

pub fn get_ws_url(&self) -> BithumbResult<&SmartString>

Get effective WebSocket URL based on testnet setting

Source

pub const fn get_http_timeout(&self) -> Duration

Get HTTP client timeout

Source

pub const fn get_ws_ping_interval(&self) -> Duration

Get WebSocket ping interval

Source

pub const fn get_rate_limit_settings(&self) -> (Duration, u32)

Get rate limit settings

Source

pub const fn get_connection_pool_settings(&self) -> (usize, Duration)

Get connection pool settings

Source

pub const fn get_ws_reconnect_settings(&self) -> (usize, Duration)

Get WebSocket reconnection settings

Trait Implementations§

Source§

impl Clone for BithumbConfig

Source§

fn clone(&self) -> BithumbConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BithumbConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BithumbConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,