pub async fn connect_with_url<'a>(
        auth: impl Into<Authentication<'a>>,
        url: &str,
    ) -> Result<Self> {
        tracing::debug!("Connecting to websocket on {}", url);
        let (stream, _response) = connect_async(url).await?;
        let mut internal = ConnectionInternal {
            stream,
            closed: false,
        };
        internal.authenticate(auth.into()).await?;

        let connection = Self {
            internal,
            ping_interval: tokio::time::interval(std::time::Duration::from_secs(15)),
        };

        Ok(connection)
    }
/// Connects to the websocket on the specified url, and authenticates, returning the socket or an error if it failed.
///
/// Use if connecting to a self-hosted instance of revolt; otherwise use [Self::connect].
Connects to the websocket on the specified url, and authenticates, returning the socket or an error if it failed.
Use if connecting to a self-hosted instance of revolt; otherwise use [Self::connect].
Connects to the websocket on the specified url and authenticates returning the socket or an error if it failed . Use if connecting to a self - hosted instance of revolt ; otherwise use [ Self :: connect ] .
pub async fn connect_with_url<'a>(
        auth: impl Into<Authentication<'a>>,
        url: &str,
    ) -> Result<Self> {
        tracing::debug!("Connecting to websocket on {}", url);
        let (stream, _response) = connect_async(url).await?;
        let mut internal = ConnectionInternal {
            stream,
            closed: false,
        };
        internal.authenticate(auth.into()).await?;
        let connection = Self {
            internal,
            ping_interval: tokio::time::interval(std::time::Duration::from_secs(15)),
        };
        Ok(connection)
    }
pub async fn connect_with_url < ' a > ( auth : impl Into < Authentication < ' a > > , url : & str , ) -> Result < Self > { tracing :: debug ! ( " " url ) ; let ( stream , _response ) = connect_async ( url ) . await ? ; let mut internal = ConnectionInternal { stream , closed : false , } ; internal . authenticate ( auth . into ( ) ) . await ? ; let connection = Self { internal , ping_interval : tokio :: time :: interval ( std :: time :: Duration :: from_secs ( 15 ) ) , } ; Ok ( connection ) }
Connects to the websocket on the specified url, and authenticates, returning the socket or an error if it failed.
Connects to the websocket on the specified url and authenticates returning the socket or an error if it failed .
auth
impl Into<Authentication<'a>>
url
&str
auth
impl Into<Authentication<'a>>
url
&str