pub enum AuthResponse {
PrivateAuth(PrivateAuthData),
TradeAuth(TradeAuthData),
}Expand description
Enum representing WebSocket authentication responses.
Encapsulates authentication responses for different WebSocket connection types (private streams and trade streams). Bots use this to verify authentication success and handle authentication failures appropriately.
Variants§
PrivateAuth(PrivateAuthData)
Authentication response for private WebSocket streams.
Used for private data streams (position, execution, order, wallet updates).
Bots should check the success field to confirm authentication.
TradeAuth(TradeAuthData)
Authentication response for trade WebSocket streams.
Used for trade/order entry streams. Has a different format than private streams.
Bots should check the ret_code field (0 for success).
Implementations§
Source§impl AuthResponse
impl AuthResponse
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true if authentication was successful.
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Returns true if authentication failed.
Sourcepub fn error_code(&self) -> Option<i32>
pub fn error_code(&self) -> Option<i32>
Returns the error code if authentication failed.
Trait Implementations§
Source§impl Clone for AuthResponse
impl Clone for AuthResponse
Source§fn clone(&self) -> AuthResponse
fn clone(&self) -> AuthResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more