pub struct WebsocketCommon {
pub events: WebsocketEventEmitter,
/* private fields */
}Fields§
§events: WebsocketEventEmitterImplementations§
Source§impl WebsocketCommon
impl WebsocketCommon
pub fn new( initial_pool: Vec<Arc<WebsocketConnection>>, mode: WebsocketMode, reconnect_delay: usize, agent: Option<AgentConnector>, user_agent: Option<String>, ) -> Arc<Self>
Sourcepub async fn is_connection_ready(
&self,
connection: &WebsocketConnection,
allow_non_established: bool,
) -> bool
pub async fn is_connection_ready( &self, connection: &WebsocketConnection, allow_non_established: bool, ) -> bool
Checks if a WebSocket connection is ready for use.
§Arguments
connection- The WebSocket connection to checkallow_non_established- If true, allows connections that are not fully established
§Returns
true if the connection is ready, false otherwise
§Behavior
A connection is considered ready if:
- It has a write channel (unless
allow_non_establishedis true) - No renewal is pending
- No reconnection is pending
- No close has been initiated
Auto Trait Implementations§
impl !Freeze for WebsocketCommon
impl !RefUnwindSafe for WebsocketCommon
impl Send for WebsocketCommon
impl Sync for WebsocketCommon
impl Unpin for WebsocketCommon
impl !UnwindSafe for WebsocketCommon
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