pub async fn connect<S: AsRef<str>>(
uri: S,
) -> Result<(Client, EventStream), WsError>Expand description
A wrapper over simploxide_core::connect that turns simploxide_core::RawClient into
Client and raw event queue into the EventStream which handle serialization/deserialization.
ⓘ
let (client, mut events) = simploxide_client::connect("ws://127.0.0.1:5225").await?;
let current_user = client.api_show_active_user().await?;
println!("{current_user:#?}");
while let Some(ev) = events.try_next().await? {
// Process events...
}