pub struct WebSocketManager { /* private fields */ }Expand description
WebSocket manager for Kick.com
Implementations§
Source§impl WebSocketManager
impl WebSocketManager
Sourcepub fn with_options(options: KickWebSocketOptions) -> Self
pub fn with_options(options: KickWebSocketOptions) -> Self
Create a new WebSocket manager with custom options
Sourcepub async fn connect(&self, channel_name: &str) -> Result<()>
pub async fn connect(&self, channel_name: &str) -> Result<()>
Connect to a specific channel’s WebSocket
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnect from the WebSocket
pub async fn on_chat_message<F>(&self, handler: F)
pub async fn on_message<F>(&self, handler: F)
pub async fn on_ready<F>(&self, handler: F)
pub async fn on_disconnected<F>(&self, handler: F)
pub async fn on_raw_message<F>(&self, handler: F)
pub async fn on_error<F>(&self, handler: F)
pub async fn on_message_deleted<F>(&self, handler: F)
pub async fn on_user_banned<F>(&self, handler: F)
pub async fn on_user_unbanned<F>(&self, handler: F)
pub async fn on_subscription<F>(&self, handler: F)
pub async fn on_gifted_subscriptions<F>(&self, handler: F)
pub async fn on_pinned_message_created<F>(&self, handler: F)
pub async fn on_stream_host<F>(&self, handler: F)
pub async fn on_poll_update<F>(&self, handler: F)
pub async fn on_poll_delete<F>(&self, handler: F)
pub async fn get_connection_state(&self) -> ConnectionState
pub async fn get_channel_name(&self) -> String
pub async fn get_channel_id(&self) -> u64
Sourcepub async fn build_websocket_url(&self) -> Result<Url>
pub async fn build_websocket_url(&self) -> Result<Url>
Build the WebSocket URL with parameters (public method for testing)
Sourcepub async fn set_websocket_url(&self, url: String)
pub async fn set_websocket_url(&self, url: String)
Set a custom WebSocket URL
Sourcepub async fn set_websocket_params(&self, params: HashMap<String, String>)
pub async fn set_websocket_params(&self, params: HashMap<String, String>)
Set custom WebSocket parameters
Sourcepub async fn reset_websocket_config(&self)
pub async fn reset_websocket_config(&self)
Reset WebSocket configuration to defaults
Sourcepub async fn get_channel_id_from_name(&self, channel_name: &str) -> Result<u64>
pub async fn get_channel_id_from_name(&self, channel_name: &str) -> Result<u64>
Get channel ID from channel name (public method for testing)
Sourcepub async fn get_chatroom_id_from_name(&self, channel_name: &str) -> Result<u64>
pub async fn get_chatroom_id_from_name(&self, channel_name: &str) -> Result<u64>
Get chatroom ID for WebSocket subscription
Sourcepub async fn export_raw_messages(&self) -> Vec<String>
pub async fn export_raw_messages(&self) -> Vec<String>
Clear the channel ID cache
pub async fn get_buffer_stats(&self) -> BufferStats
Sourcepub async fn export_raw_messages_by_event_type(
&self,
event_type: KickEventType,
) -> Vec<String>
pub async fn export_raw_messages_by_event_type( &self, event_type: KickEventType, ) -> Vec<String>
Export raw messages by event type
Sourcepub async fn export_raw_messages_in_range(
&self,
start_index: usize,
end_index: Option<usize>,
) -> Vec<String>
pub async fn export_raw_messages_in_range( &self, start_index: usize, end_index: Option<usize>, ) -> Vec<String>
Export raw messages in range
Sourcepub async fn clear_raw_messages_by_event_type(
&self,
event_type: KickEventType,
) -> Result<()>
pub async fn clear_raw_messages_by_event_type( &self, event_type: KickEventType, ) -> Result<()>
Clear raw messages by event type
Sourcepub async fn set_custom_user_agent(&self, user_agent: String)
pub async fn set_custom_user_agent(&self, user_agent: String)
Set a custom User-Agent for WebSocket connections
Sourcepub async fn set_user_agent_rotation(&self, enabled: bool)
pub async fn set_user_agent_rotation(&self, enabled: bool)
Enable or disable User-Agent rotation for WebSocket connections
Sourcepub async fn get_user_agent_config(&self) -> (Option<String>, bool)
pub async fn get_user_agent_config(&self) -> (Option<String>, bool)
Get current User-Agent configuration
Sourcepub async fn reset_user_agent(&self)
pub async fn reset_user_agent(&self)
Reset User-Agent to default behavior (rotation enabled)
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if the client is connected to WebSocket
Sourcepub async fn has_handlers(&self) -> bool
pub async fn has_handlers(&self) -> bool
Check if any event handlers are registered
Trait Implementations§
Source§impl Clone for WebSocketManager
impl Clone for WebSocketManager
Source§fn clone(&self) -> WebSocketManager
fn clone(&self) -> WebSocketManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more