pub struct Config {
pub api_url: String,
pub websocket_url: String,
pub private_websocket_url: String,
pub business_websocket_url: String,
pub api_timeout_ms: u64,
pub request_expiration_ms: i64,
pub is_simulated_trading: String,
}Expand description
OKX SDK配置
Fields§
§api_url: StringAPI基础URL
websocket_url: StringWebSocket URL
private_websocket_url: String私有WebSocket URL
business_websocket_url: String业务WebSocket URL
api_timeout_ms: u64API超时时间(毫秒)
request_expiration_ms: i64请求有效时间(毫秒)
is_simulated_trading: String是否为模拟交易
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_api_url(self, api_url: impl Into<String>) -> Self
pub fn with_api_url(self, api_url: impl Into<String>) -> Self
设置API基础URL
Sourcepub fn with_websocket_url(self, websocket_url: impl Into<String>) -> Self
pub fn with_websocket_url(self, websocket_url: impl Into<String>) -> Self
设置WebSocket URL
Sourcepub fn with_private_websocket_url(
self,
private_websocket_url: impl Into<String>,
) -> Self
pub fn with_private_websocket_url( self, private_websocket_url: impl Into<String>, ) -> Self
设置私有WebSocket URL
Sourcepub fn with_business_websocket_url(
self,
business_websocket_url: impl Into<String>,
) -> Self
pub fn with_business_websocket_url( self, business_websocket_url: impl Into<String>, ) -> Self
设置业务WebSocket URL
Sourcepub fn with_api_timeout_ms(self, timeout_ms: u64) -> Self
pub fn with_api_timeout_ms(self, timeout_ms: u64) -> Self
设置API超时时间
Sourcepub fn with_request_expiration_ms(self, expiration_ms: i64) -> Self
pub fn with_request_expiration_ms(self, expiration_ms: i64) -> Self
设置请求有效时间
Sourcepub fn with_simulated_trading(self, is_simulated: String) -> Self
pub fn with_simulated_trading(self, is_simulated: String) -> Self
设置是否为模拟交易
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more